From e52ff69ea109f4935bdf8f0da5cf4e0fb3e7e20d Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Thu, 14 Jul 2022 15:55:13 +0200 Subject: [PATCH] [IMP] support customization of the custom conf path. This allow you to potentially build different configuration files based on the environment you are using. --- README.md | 87 ++++++++++++++++++++++++--------------------- bin/config-generate | 3 +- 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 205733ab..495c76f6 100644 --- a/README.md +++ b/README.md @@ -38,46 +38,50 @@ You can start working with this straight away with our [template][]. -- [Image usage](#image-usage) - - [`/opt/odoo/custom`: The important one](#optodoocustom-the-important-one) - - [`/opt/odoo/custom/entrypoint.d`](#optodoocustomentrypointd) - - [`/opt/odoo/custom/build.d`](#optodoocustombuildd) - - [`/opt/odoo/custom/conf.d`](#optodoocustomconfd) - - [`/opt/odoo/custom/ssh`](#optodoocustomssh) - - [`/opt/odoo/custom/src`](#optodoocustomsrc) - - [`/opt/odoo/custom/src/odoo`](#optodoocustomsrcodoo) - - [`/opt/odoo/custom/src/private`](#optodoocustomsrcprivate) - - [`/opt/odoo/custom/src/repos.yaml`](#optodoocustomsrcreposyaml) - - [Automatic download of repos](#automatic-download-of-repos) - - [`/opt/odoo/custom/src/addons.yaml`](#optodoocustomsrcaddonsyaml) - - [`/opt/odoo/custom/dependencies/*.txt`](#optodoocustomdependenciestxt) - - [`/opt/odoo/common`: The useful one](#optodoocommon-the-useful-one) - - [`/opt/odoo/auto`: The automatic one](#optodooauto-the-automatic-one) - - [`/opt/odoo/auto/addons`](#optodooautoaddons) - - [`/opt/odoo/auto/odoo.conf`](#optodooautoodooconf) -- [The `Dockerfile`](#the-dockerfile) -- [Bundled tools](#bundled-tools) - - [`addons`](#addons) - - [`click-odoo` and related scripts](#click-odoo-and-related-scripts) - - [`nano`](#nano) - - [`log`](#log) - - [`pot`](#pot) - - [`psql`](#psql) - - [`inotify`](#inotify) - - [`debugpy`](#debugpy) - - [`pudb`](#pudb) - - [`git-aggregator`](#git-aggregator) - - [`autoaggregate`](#autoaggregate) - - [Example `repos.yaml` file](#example-reposyaml-file) - - [`odoo`](#odoo) -- [Subproject template](#subproject-template) -- [FAQ](#faq) - - [Will there be not retrocompatible changes on the image?](#will-there-be-not-retrocompatible-changes-on-the-image) - - [This project is too opinionated, but can I question any of those opinions?](#this-project-is-too-opinionated-but-can-i-question-any-of-those-opinions) - - [What's this `hooks` folder here?](#whats-this-hooks-folder-here) - - [How can I pin an image version?](#how-can-i-pin-an-image-version) - - [How can I help?](#how-can-i-help) -- [Related Projects](#related-projects) +- [Doodba](#doodba) + - [What?](#what) + - [Why?](#why) + - [How?](#how) + - [Image usage](#image-usage) + - [`/opt/odoo/custom`: The important one](#optodoocustom-the-important-one) + - [`/opt/odoo/custom/entrypoint.d`](#optodoocustomentrypointd) + - [`/opt/odoo/custom/build.d`](#optodoocustombuildd) + - [`/opt/odoo/custom/conf.d`](#optodoocustomconfd) + - [`/opt/odoo/custom/ssh`](#optodoocustomssh) + - [`/opt/odoo/custom/src`](#optodoocustomsrc) + - [`/opt/odoo/custom/src/odoo`](#optodoocustomsrcodoo) + - [`/opt/odoo/custom/src/private`](#optodoocustomsrcprivate) + - [`/opt/odoo/custom/src/repos.yaml`](#optodoocustomsrcreposyaml) + - [Automatic download of repos](#automatic-download-of-repos) + - [`/opt/odoo/custom/src/addons.yaml`](#optodoocustomsrcaddonsyaml) + - [`/opt/odoo/custom/dependencies/*.txt`](#optodoocustomdependenciestxt) + - [`/opt/odoo/common`: The useful one](#optodoocommon-the-useful-one) + - [`/opt/odoo/auto`: The automatic one](#optodooauto-the-automatic-one) + - [`/opt/odoo/auto/addons`](#optodooautoaddons) + - [`/opt/odoo/auto/odoo.conf`](#optodooautoodooconf) + - [The `Dockerfile`](#the-dockerfile) + - [Bundled tools](#bundled-tools) + - [`addons`](#addons) + - [`click-odoo` and related scripts](#click-odoo-and-related-scripts) + - [`nano`](#nano) + - [`log`](#log) + - [`pot`](#pot) + - [`psql`](#psql) + - [`inotify`](#inotify) + - [`debugpy`](#debugpy) + - [`pudb`](#pudb) + - [`git-aggregator`](#git-aggregator) + - [`autoaggregate`](#autoaggregate) + - [Example `repos.yaml` file](#example-reposyaml-file) + - [`odoo`](#odoo) + - [Subproject template](#subproject-template) + - [FAQ](#faq) + - [Will there be not retrocompatible changes on the image?](#will-there-be-not-retrocompatible-changes-on-the-image) + - [This project is too opinionated, but can I question any of those opinions?](#this-project-is-too-opinionated-but-can-i-question-any-of-those-opinions) + - [What's this `hooks` folder here?](#whats-this-hooks-folder-here) + - [How can I pin an image version?](#how-can-i-pin-an-image-version) + - [How can I help?](#how-can-i-help) + - [Related Projects](#related-projects) @@ -141,6 +145,9 @@ subsequently run. Files here will be environment-variable-expanded and concatenated in `/opt/odoo/auto/odoo.conf` in the entrypoint. +You can use a different custom directory to concatenate the configuration by using the +`CUSTOM_CONF_DIR` environment variable in the odoo service of the compose specific file. + #### `/opt/odoo/custom/ssh` It must follow the same structure as a standard `~/.ssh` directory, including `config` diff --git a/bin/config-generate b/bin/config-generate index 7865890d..921679af 100755 --- a/bin/config-generate +++ b/bin/config-generate @@ -26,7 +26,8 @@ except ImportError: ODOO_VERSION = os.environ.get("ODOO_VERSION") TARGET_FILE = os.environ.get("ODOO_RC", "/opt/odoo/auto/odoo.conf") -CONFIG_DIRS = ("/opt/odoo/common/conf.d", "/opt/odoo/custom/conf.d") +CUSTOM_CONF_DIR = os.environ.get("CUSTOM_CONF_DIR", "/opt/odoo/custom/conf.d") +CONFIG_DIRS = ("/opt/odoo/common/conf.d", CUSTOM_CONF_DIR) CONFIG_FILES = [] # Read all configuraiton files found in those folders