This project itself is just the template, but you need to install these tools to use it:
- Linux1
- copier
- docker-compose
- git 2.24 or newer
- invoke installed in Python 3.6+ (and the binary must be
called
invoke
— beware if your distro installs it asinvoke3
or similar). - pre-commit
- python 3.6+
- venv
Install non-python apps with your distro's recommended package manager, executing the follow commands:
sudo apt update -y && sudo apt upgrade -y
sudo apt install -y git git-flow
sudo apt install -y python-dev python3-pip python3-virtualenv python3-argcomplete
The recommended way to install Python CLI apps is pipx, executing the follow commands:
python3 -m pip install --user pipx
~/.local/bin/pipx ensurepath --force
pipx completions
eval "$(register-python-argcomplete3 pipx)"
pipx install docker-compose
pipx install copier
pipx install invoke
pipx install pre-commit
pipx ensurepath --force
Once you installed everything, you can now use Copier to copy this template, executing the follow commands:
copier copy gh:Tecnativa/doodba-copier-template ~/path/to/your/subproject
cd ~/path/to/your/subproject
Once you created the doodba template for your project, you can now start the project, executing the follow commands:
invoke git-aggregate
invoke start
Once you started the doodba template for your project, you can now start the Development Environment, executing the follow commands:
docker-compose -f devel.yaml up
Once you started the doodba template for your project, you can now start the Staging Environment, executing the follow commands:
docker-compose -f test.yaml up
Once you started the doodba template for your project, you can now start the Production Environment, executing the follow commands:
docker-compose -f prod.yaml up
Once you started any environments from doodba template for your project, you can the Debugging Logs, executing the follow commands:
docker-compose logs --tail 50 -f odoo
Invoke is a Python task execution tool & library. Following the lead of most Unix CLI applications, it offers a traditional flag-based style of command-line parsing, deriving flag names and value types from task signatures (optionally, of course!). Like many of its predecessors, it offers advanced features as well – namespacing, task aliasing, before/after hooks, parallel execution and more.
Get more information at pyinvoke.org
# List all tasks invoke can find in the current direktory (from tasks.py)
invoke --list
# Only show commands that would be executed by called task(s) (dry run)
invoke -e -R img-pull
# run a task with debug output and echoing the commands
invoke -d -e img-pull
A multi-language package manager for pre-commit git hooks. You specify a list of hooks you want and pre-commit manages the installation and execution of any hook written in any language before every commit. Get more information at pre-commit.com Github repository at github.com/pre-commit/pre-commit. To use pre-commit hooks for your python project you need to create a configuration file first and then install all the hooks in the configuration file via pre-commit install
.
exclude: |
# NOT INSTALLABLE ADDONS
# END NOT INSTALLABLE ADDONS
(?x)
# Files and folders generated by bots, to avoid loops
/static/description/index\.html$|
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
python: python3
node: "14.14.0"
repos:
- repo: local
hooks:
- id: forbidden-files
name: forbidden files
entry: found forbidden files; remove them
language: fail
files: "\\.rej$"
- repo: https://github.com/oca/maintainer-tools
rev: b9c963d
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
args:
- --addons-dir
- odoo/custom/src/private
...
$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
[michaelkarrer@~/odoo-new-setup/install_doodba/doodba_subproject_by_copier (master +)]$ git commit -m "First commit of doodba scaffolding test project"
[INFO] Initializing environment for https://github.com/oca/maintainer-tools.
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://github.com/asottile/pyupgrade.
[INFO] Initializing environment for https://github.com/timothycrosley/isort.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:@prettier/[email protected],[email protected].
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8:flake8-bugbear==20.1.4.
[INFO] Initializing environment for https://github.com/pycqa/pylint.
[INFO] Initializing environment for https://github.com/pycqa/pylint:isort==4.3.21,pylint-odoo==3.6.0.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-eslint.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-eslint:[email protected].
[INFO] Installing environment for https://github.com/oca/maintainer-tools.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
...
1 Any modern distro should work. Ubuntu and Fedora are officially supported. Other systems are not tested. If you're on Windows, you'll probably need WSL or a Linux VM to work with doodba without problems. If you use other systems and find a way to make these tools work, please consider opening a PR to add some docs that might help others with your situation.