Skip to content

Commit

Permalink
[IMP] support customization of the custom conf path.
Browse files Browse the repository at this point in the history
This allow you to potentially build different configuration files
based on the environment you are using.
  • Loading branch information
LoisRForgeFlow committed Jul 14, 2022
1 parent 28b16c8 commit e52ff69
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 41 deletions.
87 changes: 47 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,50 @@ You can start working with this straight away with our [template][].

<!-- toc -->

- [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)

<!-- tocstop -->

Expand Down Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion bin/config-generate
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e52ff69

Please sign in to comment.