-
-
Notifications
You must be signed in to change notification settings - Fork 33
[14.0] OCA' Odoo instance docker image #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fa682b5
[ADD] oca_all: module with all OCA instance dependencies
petrus-v 7e6469b
[FIX] website_oca_psc_team: fix tour
petrus-v ca58564
[IMP] OCA's Odoo: odoo-community.org development/release
petrus-v 0a184cd
[CI] ignore unreleased dependencies
petrus-v d3df5a7
Use standard mechanism to declare dev dependencies
sbidoul e59e4f0
Use explicit docker cache id
sbidoul 4b5a67f
Add openupgradelib
sbidoul 21b163e
Tweak comment in entrypoint
sbidoul ea80811
Merge pull request #1 from acsone/14.0-tweak-build-sbi
petrus-v 0168aff
FIX oca_all dependencies
petrus-v 68ca9bc
freeze pytest version
petrus-v 82b6c31
[IMP] docker entrypoint install oca_all if empty database
petrus-v 171976d
Add missing depenencies likes in production
petrus-v 2c358cf
kwkhtmltopdf use init:true to quickly stop properly propagate signals
petrus-v d755726
add click-odoo fix membership line maintenance script
petrus-v 8d34297
integrate account_statement_import_online_wise Tom's fix using forein…
petrus-v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,161 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| pip-wheel-metadata/ | ||
| share/python-wheels/ | ||
| **.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py,cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
| db.sqlite3 | ||
| db.sqlite3-journal | ||
|
|
||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
|
|
||
| # Scrapy stuff: | ||
| .scrapy | ||
|
|
||
| # Sphinx documentation | ||
| docs/_build/ | ||
|
|
||
| # PyBuilder | ||
| target/ | ||
|
|
||
| # Jupyter Notebook | ||
| .ipynb_checkpoints | ||
|
|
||
| # IPython | ||
| profile_default/ | ||
| ipython_config.py | ||
|
|
||
| # pyenv | ||
| .python-version | ||
|
|
||
| # pipenv | ||
| # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
| # However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
| # having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
| # install all needed dependencies. | ||
| #Pipfile.lock | ||
|
|
||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
| __pypackages__/ | ||
|
|
||
| # Celery stuff | ||
| celerybeat-schedule | ||
| celerybeat.pid | ||
|
|
||
| # SageMath parsed files | ||
| *.sage.py | ||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
| *.ps | ||
| *.xlsx | ||
|
|
||
| .filestore/ | ||
| src/ | ||
| setup/ | ||
| Dockerfile | ||
| .copier-answers.yml | ||
| .dockerignore | ||
| .filestore/ | ||
| .editorconfig | ||
| .eslintrc.yml | ||
| .git | ||
| .github | ||
| .gitignore | ||
| .oca_hooks.cfg | ||
| .pre-commit-config.yaml | ||
| .prettierrc.yml | ||
| .pylintrc | ||
| .pylintrc-mandatory | ||
| .ruff.toml | ||
| .CONTRIBUTE.md | ||
| .pytest_cache/ | ||
| .ruff_cache/ | ||
| README.md | ||
| repos.yaml | ||
| requirements.txt | ||
| test-requirements.txt | ||
| oca_dependencies.txt | ||
| setup.cfg | ||
| tasks.py | ||
| .vscode | ||
| nohup.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: Build Docker Image | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - "14.0*" | ||
| push: | ||
| branches: | ||
| - "14.0" | ||
| tags: | ||
| - 'v14.0.*' | ||
|
|
||
| env: | ||
| OWNER: "oca" | ||
|
|
||
|
|
||
| jobs: | ||
| build_docker_image: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - | ||
| name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
| - | ||
| name: Login to ghcr.io | ||
| if: ${{ github.repository_owner == env.OWNER && github.ref == 'refs/heads/14.0' || startsWith(github.ref, 'refs/tags/') }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - | ||
| name: Build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| tags: | | ||
| ghcr.io/${{ env.OWNER }}/oca-custom:14.0-oca-latest | ||
| cache-from: type=registry,ref=ghcr.io/oca/oca-custom:14.0-oca-latest | ||
| cache-to: type=local,dest=/tmp/.buildx-cache | ||
| pull: true | ||
| load: true | ||
| - | ||
| name: Test install oca_all in docker image | ||
| run: | | ||
| # First start installing the database | ||
| docker compose up --wait odoo | ||
| docker compose stop odoo | ||
| # purpose it to test update entrypoints | ||
| docker compose up --wait odoo | ||
| - | ||
| name: Push latests cache image | ||
| if: ${{ github.repository_owner == env.OWNER && github.ref == 'refs/heads/14.0' }} | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| tags: | | ||
| ghcr.io/${{ env.OWNER }}/oca-custom:14.0-oca-latest | ||
| cache-from: type=local,src=/tmp/.buildx-cache | ||
| cache-to: type=inline | ||
| push: true | ||
| - | ||
| name: Push image with tag if tagged | ||
| if: ${{ github.repository_owner == env.OWNER && startsWith(github.ref, 'refs/tags/') }} | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile | ||
| tags: | | ||
| ghcr.io/${{ env.OWNER }}/oca-custom:${{ github.ref_name }} | ||
| cache-from: type=local,src=/tmp/.buildx-cache | ||
| cache-to: type=inline | ||
| push: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,3 +86,5 @@ docs/_build/ | |
|
|
||
| # OCA rules | ||
| !static/lib/ | ||
| src/ | ||
| .env | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Contribute to the OCA's Odoo instance | ||
|
|
||
| This guide aims to help happy volunteers to contribute to the OCA's Odoo instance. I | ||
| suppose mainly the OCA's Internal Tools team. | ||
|
|
||
| It's split into 3 sections: | ||
|
|
||
| - [Concepts](#concepts): Main concepts to understand and general organization | ||
| - [Processes](#processes): Helping doing the work without missing crucial steps | ||
| - [HowTos](#howto): How to do specific tasks | ||
|
|
||
| ## Concepts | ||
|
|
||
| This repository is setup as other OCA's repositories to launch CI as usual and as an | ||
| extra configuration in order to build the OCA' Docker image used by our Odoo instance, | ||
| as well as facilitate the bootstrapping of a development environment. | ||
|
|
||
| Managing and freezing modules versions rely on python tools: | ||
|
|
||
| - [uv](https://docs.astral.sh/uv/) | ||
| - [hatch-odoo](https://pypi.org/project/hatch-odoo/) | ||
|
|
||
| ## Processes | ||
|
|
||
| Here we focus on what to do without explaining how to do it. | ||
|
|
||
| ### Release | ||
|
|
||
| - Add a tag to any git commit (prefer a commit in the 14.0 branch even this is not | ||
| required which could helps if needs to quickly deliver a bug fix) and push it to the | ||
| repo (ie: | ||
| `git tag -am "New release 2025-05-24" v14.0-20250524 && git push oca v14.0-20250524`). | ||
|
|
||
| - This will will trigger other flow to create the docker image. Tag must matched | ||
| following pattern to trigner the CI `v14.0.*`. | ||
|
|
||
| - A new docker image should be available in the | ||
| [github docker registry](https://github.com/oca/oca-custom/pkgs/container/oca-custom) | ||
|
|
||
| ### deployment | ||
|
|
||
| Ask administrator to deploy the given version. | ||
|
|
||
| ## HowTos | ||
|
|
||
| Here we focus on how to do it, it's a suggest way to works but feel free to use your own | ||
| way. | ||
|
|
||
| ### Setup developer environment | ||
|
|
||
| Requirements: | ||
|
|
||
| - Postgresql | ||
| - [uv](https://docs.astral.sh/uv/) | ||
| - Some dependencies to be able to build some python packages: `libpq-dev`, | ||
| `build-essential`, TODO | ||
sbidoul marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - wkhtmltopdf | ||
|
|
||
| Prepare a python virtual environment with the correct python version (which uv will | ||
| download for you if necessary) and install the required dependencies: | ||
|
|
||
| ```bash | ||
| uv sync | ||
| ``` | ||
|
|
||
petrus-v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ### Development | ||
|
|
||
| For addons living in this repository, you can just change code and restart Odoo with the | ||
| `uv run` command. | ||
|
|
||
| For addons in other repositories, the procedure is as follows: | ||
|
|
||
| - check out the repository somewhere, ie /src/\$repo | ||
| - add the following line to `pyproject.toml` in the `[tool.uv.sources]` section: | ||
|
|
||
| odoo14-addon-$youraddon = { path = "/srv/$repo/setup/$youraddon", editable = true } | ||
|
|
||
| - run `uv sync` | ||
| - restart Odoo | ||
|
|
||
| ### Setup database and launch tests | ||
|
|
||
| - setup database with demo data and all oca modules installed | ||
|
|
||
| ```bash | ||
| uv run odoo -d oca-custom -i oca_all --stop-after-init --without-de | ||
| ``` | ||
|
|
||
| - run tests using pytest launcher | ||
|
|
||
| ````bash | ||
| uv run pytest --odoo-database oca-custom --cov ./oca_psc_team/ oca_psc_team/ | ||
| `` | ||
|
|
||
| ### Update OCB Branch | ||
|
|
||
| ```bash | ||
| uv sync -P odoo | ||
| ```` | ||
|
|
||
| ### Update a specific OCA module dependency using the latest pypi release | ||
|
|
||
| ```bash | ||
| uv sync -P odoo14-addon-<module-name> | ||
| ``` | ||
|
|
||
| ### Bump all dependencies to the latest version | ||
|
|
||
| ```bash | ||
| uv sync -U | ||
| ``` | ||
hbrunn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not strictly necessary and takes some time likes
-u all. This test some how 000_10_odoo-update entry point with a database installed (it not strictly assert that the update has been done). While the -i oca_all test without odoo database!Any opinion on this?