- Remove default `ODOO_ADDONS_PATH` from top-level variables - Move `ODOO_ADDONS_PATH` initialization inside the `start` function for Odoo context - Remove unused `container-login` function - Update documentation generation to use `.md` files instead of `.rst` for `DESCRIPTION` and `CONTRIBUTORS`
3112 lines
99 KiB
Bash
Executable File
3112 lines
99 KiB
Bash
Executable File
#!/bin/bash
|
|
cd "$(dirname "$0")" || exit
|
|
# Commands such as git pull return exit code if there are no changes
|
|
# set -e
|
|
|
|
if [[ -a ".env" ]]; then
|
|
source .env
|
|
fi
|
|
|
|
help-table() {
|
|
local -a rows
|
|
local max_cmd=7 max_opt=6 max_desc=11
|
|
|
|
rows+=("Command|Option|Description")
|
|
rows+=("===ENV===| | ")
|
|
rows+=("copy-dotenv|<env><env>|Copy .env file.")
|
|
rows+=("create-dotenv|<env><type>|Create .env file of type nextcloud, odoo, upgrade.")
|
|
rows+=("edit-dotenv|<env>|Open .env file in default editor.")
|
|
rows+=("list-dotenv||List .env files.")
|
|
rows+=("load-dotenv|<env>|Load and export .env file.")
|
|
rows+=("remove-dotenv|<env>|Remove environment config.")
|
|
rows+=("rename-dotenv|<env><env>|Rename .env file.")
|
|
rows+=("restore-dotenv-files|<path>|Extract and copy .env files from backup file.")
|
|
rows+=("show-dotenv|<env>|Output content of the .env file.")
|
|
rows+=("===GIT===| | ")
|
|
rows+=("aggregate-git-folders|<path>|Run gitaggregate for the repos.yaml.")
|
|
rows+=("add-git-folder|<branch><url><path>|Add git folder to .gitmodules.")
|
|
rows+=("checkout|<version>|Checkout Odoo version.")
|
|
rows+=("checkout-git-folder|<branch><path>|Checkout git commit from .gitmodules.")
|
|
rows+=("commit-git-folder|<message><path>|Commit all changes in path.")
|
|
rows+=("clean-git-folder|<path>|Clean git folder.")
|
|
rows+=("clone-git-folder|<branch>|Clone git folder listed in the .gitmodules file.")
|
|
rows+=("download-git-folder|<grep>|Download git folder listed in the .gitmodules file.")
|
|
rows+=("status-git-folder|<path>|Show status for git folder in path.")
|
|
rows+=("list-git-folder|<path>|List path and url of git folders.")
|
|
rows+=("pull-git-folder|<branch><path>|Pull all git folders listed in the .gitmodules file.")
|
|
rows+=("push-git-folder|<path>|Push all git folders in path.")
|
|
rows+=("remove-git-folder|<path>|Remove git folders in path.")
|
|
rows+=("ls-git-folder|<grep>|List git folders path space separated.")
|
|
rows+=("reset-git-folder|<path>|Abort rebase and reset git folder.")
|
|
rows+=("stage-git-folder|<path>|Stage all files in git folders in path.")
|
|
rows+=("switch-git-folder|<branch><path>|Switch branch for all git folders from the .gitmodules file.")
|
|
rows+=("sync-git-folder|<branch><path>|Switch, stash and pull all git folders.")
|
|
rows+=("run-pre-commit|<path>|Run pre-commit in path.")
|
|
rows+=("===DOCKER===| | ")
|
|
rows+=("archive-docker-tags||Archive Docker image tags on hub older than 1 year.")
|
|
rows+=("build-odoo|[output]|Build Odoo Docker image.")
|
|
rows+=("build-odoo-mailgate|[output]|Build Odoo Mailgate Docker image.")
|
|
rows+=("build-odoo-upgrade|[output]|Build Odoo Upgrade Docker image.")
|
|
rows+=("build-odoo-cli|[output]|Build Odoo CLI Docker image.")
|
|
rows+=("login-docker|[user][token]|Setup Docker Hub login credentials.")
|
|
rows+=("login-podman|[user][token]|Login into registry with podman.")
|
|
rows+=("update-docker-hub-readme||Update Docker Hub repository READMEs from image folders.")
|
|
rows+=("container-ps||List container processes.")
|
|
rows+=("remove|[name]|Remove containers and volumes.")
|
|
rows+=("test-image-script|<folder>|Test scripts of target Docker image folder.")
|
|
rows+=("test-odoo-version-regex||Test the Odoo module version regex filter.")
|
|
rows+=("===VUEPRESS===| | ")
|
|
rows+=("build-vuepress||Create Vuepress build.")
|
|
rows+=("install-vuepress||Install Node build dependencies.")
|
|
rows+=("dev-vuepress||Start Vuepress development server.")
|
|
rows+=("serve-vuepress||Serve Vuepress build.")
|
|
rows+=("===DATABASE===| | ")
|
|
rows+=("clear-assets|[db]|Clear all assets of Odoo database.")
|
|
rows+=("clear-filestore|<db>|Clear local filestore folder.")
|
|
rows+=("clear-views|[db]|Clear all views of Odoo database.")
|
|
rows+=("cloc-odoo|[db]|Count custom line of codes.")
|
|
rows+=("drop-db|[db]|Drop target Odoo database.")
|
|
rows+=("init-db|[db]|Initialize the Odoo database.")
|
|
rows+=("load-language|<db>[lang]|Install language package in Odoo db.")
|
|
rows+=("patch-database|<db>[path]|Apply sql file to database.")
|
|
rows+=("reset-views|<db>[key]|Execute hard reset on views matching keys.")
|
|
rows+=("set-admin|[db]|Sets the password for the first user in database.")
|
|
rows+=("update-module|<db>[name,path]|Update target Odoo module.")
|
|
rows+=("update-module-list|<db>|Update module list of Odoo database.")
|
|
rows+=("===REVISION===| | ")
|
|
rows+=("checkout-latest-revision|[version]|Checkout the latest revision of the Odoo version.")
|
|
rows+=("checkout-revision|[revision]|Load Odoo revision env var and checkout git folders.")
|
|
rows+=("commit-and-push-revision|[revision]|Commit all changes and tag with current revision.")
|
|
rows+=("create-revision|<revision>|Create new Odoo revision.")
|
|
rows+=("list-revision||List available Odoo revisions.")
|
|
rows+=("load-latest-revision|[version]|Load the latest revision of the Odoo version.")
|
|
rows+=("load-revision|[revision]|Load env var from specified revision.")
|
|
rows+=("show-revision|[revision]|Show references of Odoo revision.")
|
|
rows+=("===LLM===| | ")
|
|
rows+=("commit-with-llm||Commit with llm generated commit message.")
|
|
rows+=("update-with-llm|<glob><prompt>|Feed module files with prompt to LLM and apply file changes.")
|
|
rows+=("===SNIPPETS===| | ")
|
|
rows+=("create-snippet|<xml-id>|Create snippet from template.")
|
|
rows+=("install-snippet|<env><path>|Install snippet definition.")
|
|
rows+=("disable-snippet|<env><path>|Disable snippet by path or xml-id.")
|
|
rows+=("enable-snippet|<env><path>|Enable snippet by path or xml-id.")
|
|
rows+=("lint-snippets||Run checks for all snippets.")
|
|
rows+=("remove-snippet|<env><path>|Remove snippet by path or xml-id.")
|
|
rows+=("update-snippet|<env><path>|Update snippet definition.")
|
|
rows+=("===INSTALL===| | ")
|
|
rows+=("activate-venv||Activate virtualenv.")
|
|
rows+=("init-venv||Initialize python virtual env.")
|
|
rows+=("install||Install Odoo requirements in source folder.")
|
|
rows+=("install-ansible-build-scripts|<role>|Install scripts of the specified Ansbile role.")
|
|
rows+=("install-requirements|<db>[path]|Install python packages from requirements.txt.")
|
|
rows+=("list-packages||List installed python packages.")
|
|
rows+=("init-module|<db>[path,module]|Initialize Odoo module.")
|
|
rows+=("set-addons-path||Set Odoo addons path env variable.")
|
|
rows+=("===DATA===| | ")
|
|
rows+=("export-website-data|[env]|Export website data from Odoo database.")
|
|
rows+=("import-csv|<db>[path]|Import data from csv. Filename is PostgreSQL table name.")
|
|
rows+=("import-website-data|[env]|Import website data to Odoo database.")
|
|
rows+=("===DEVELOP===| | ")
|
|
rows+=("create-module|<path>|Create new Odoo module from template.")
|
|
rows+=("create-repo|<path>|Create a new Odoo module repo.")
|
|
rows+=("init-repo-branch|<path>|Create branch for current Odoo version in repo.")
|
|
rows+=("generate-module-docs|<path>|Generate readme file for module with OCA tools.")
|
|
rows+=("generate-module-model|<path><model>|Generate model in module folder.")
|
|
rows+=("generate-module-inherit-model|<path><model>|Generate inherited model in module folder.")
|
|
rows+=("generate-module-views|<path><model>|Generate model views in module folder.")
|
|
rows+=("generate-module-security|<path><model>|Generate model access file.")
|
|
rows+=("generate-module-migration|<path>|Generate migration script for currentmodule version.")
|
|
rows+=("generate-module-inherit-view|<path><ref><model>|Generate snippet for referefenced view.")
|
|
rows+=("generate-module-report|<path><model>|Generate report for a model in module folder.")
|
|
rows+=("generate-module-translation|<path>|Generate module translation and update with llm.")
|
|
rows+=("generate-module-wizard|<path><model>|Generate wizard for a model in module folder.")
|
|
rows+=("generate-repo-docs|<path>|Generate repo files from template.")
|
|
rows+=("===MODULE===| | ")
|
|
rows+=("list-modules|<path>|Get modules in path as bash array.")
|
|
rows+=("pytest-module|<path>|Run module tests with pytest.")
|
|
rows+=("release-module|<path>|Create GitHub release for a module.")
|
|
rows+=("register-module-repos|[version][path]|Register module repos on apps.odoo.com.")
|
|
rows+=("uninstall-module|<db>[name]|Remove target Odoo module.")
|
|
rows+=("test-module|<path>|Test target Odoo module.")
|
|
rows+=("test-modules|<path>|Test target Odoo modules in repo folder.")
|
|
rows+=("translate-module|<path>[lang][db]|Generate translation for Odoo module.")
|
|
rows+=("upload-module|<env><path>|Zip and upload Odoo module.")
|
|
rows+=("visualize-dependencies|<path>|Generate visualizations of module dependencies.")
|
|
rows+=("zip-module|<path>|Create zip file for module.")
|
|
rows+=("===HELPER===| | ")
|
|
rows+=("generate-admin-password|<pass>|Generate hash for Odoo master password.")
|
|
rows+=("generate-ssh-keys||Generate ssh key pair.")
|
|
rows+=("generate-pg-ssl-keys||Generate PostgreSQL SSL key material.")
|
|
rows+=("get-addons-path||Output addons path.")
|
|
rows+=("get-modules|<path>[option]|Get list of modules in path. 'basename' or 'dirname'.")
|
|
rows+=("get-module-version|<path>|Get module version from manifest.")
|
|
rows+=("get-module-checksum|<path>|Get module checksum.")
|
|
rows+=("help|[grep]|Show help for commands.")
|
|
rows+=("info||Show values of project env vars.")
|
|
rows+=("load-ssh-key||Load SSH private key from env var.")
|
|
rows+=("update-module-license|<grep>|Update LICENSE file for each matching module.")
|
|
rows+=("===RUN===| | ")
|
|
rows+=("list-services||List available services.")
|
|
rows+=("debug|<name>|Debug application.")
|
|
rows+=("exec|<name><cmd>|Run command in container.")
|
|
rows+=("logs|[name]|Tail container logs. Default is '\''odoo'\''.")
|
|
rows+=("manifestoo|[param]|Execute manifestoo cli.")
|
|
rows+=("odoobin|[param]|Execute odoo binary.")
|
|
rows+=("odoocli|[param]|Execute odoocli cli.")
|
|
rows+=("psql|[db]|Start interactive psql shell.")
|
|
rows+=("restart|[name]|Restart container.")
|
|
rows+=("run|<name><cmd>|Run container with command.")
|
|
rows+=("shell|[db][code]|Start interactive odoo shell or run code.")
|
|
rows+=("source||Source the Python virtual env.")
|
|
rows+=("start|[name][db]|Start service.")
|
|
rows+=("stop|[name]|Stop containers.")
|
|
rows+=("test-xmlrpc|<env>|Test xml rpc connection.")
|
|
rows+=("test-json-2|<env>|Test JSON API connection.")
|
|
rows+=("===PROJECT===| | ")
|
|
rows+=("lint||Run precommit for this project.")
|
|
rows+=("list-versions||List available Odoo versions.")
|
|
rows+=("check-version||Check if Odoo source is the correct version.")
|
|
rows+=("load-version|[version]|Load git refs from version folder.")
|
|
rows+=("save-version||Save git folder refs to version folder.")
|
|
rows+=("template-compose||Template the Docker compose file.")
|
|
rows+=("template-odoo-rc||Template the Odoo config file.")
|
|
rows+=("test-project|[cleanup]|Run tests for this project.")
|
|
rows+=("version||Show version of required tools.")
|
|
rows+=("===PERFORMANCE===| | ")
|
|
rows+=("record-with-memray|<name>|Record application memory usage with memray.")
|
|
rows+=("record-with-py-spy|<pid>|Record and create flamechart for a process.")
|
|
rows+=("===DOC===| | ")
|
|
rows+=("update-docs||Update all project docs.")
|
|
rows+=("update-modules-doc||Update modules docs file.")
|
|
rows+=("update-revisions-doc||Update revisions doc file.")
|
|
rows+=("update-snippets-doc||Update snippets doc file.")
|
|
rows+=("===UPGRADE===| | ")
|
|
rows+=("prepare-migration-brach|<path><module><version>|Create migration branch for a module.")
|
|
rows+=("migrate-module|<path>|Migrate module code to target Odoo version.")
|
|
rows+=("backport-module|<path>|Backport module code to target Odoo version.")
|
|
rows+=("run-openupgrade|<db>|Run Odoo OpenUpgrade scripts for target database.")
|
|
rows+=("===JUPYTER===| | ")
|
|
rows+=("init-odoo-jupyter|<path>|Init jypyter lab directory.")
|
|
rows+=( |