Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,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: 3 additions & 0 deletions bin/config-generate
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ 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")
if CUSTOM_CONF_DIR:
CONFIG_DIRS += (CUSTOM_CONF_DIR,)
CONFIG_FILES = []

# Read all configuraiton files found in those folders
Expand Down
3 changes: 2 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ def _check_dotd(self, scaffolding_dir, odoo_skip):
# ``custom/entrypoint.d`` was properly executed
("test", "-f", "/home/odoo/created-at-entrypoint"),
# ``custom/conf.d`` was properly concatenated
("grep", "test-conf", "auto/odoo.conf"),
("grep", "-F", "[conf]", "auto/odoo.conf"),
("grep", "-F", "[test-conf]", "auto/odoo.conf"),
# ``custom/dependencies`` were installed
("test", "!", "-e", "/usr/sbin/sshd"),
("test", "!", "-e", "/var/lib/apt/lists/lock"),
Expand Down
1 change: 1 addition & 0 deletions tests/scaffoldings/dotd/custom/conf.d/conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[conf]
1 change: 1 addition & 0 deletions tests/scaffoldings/dotd/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
PGPASSWORD: anotherodoopassword
PGHOST: postgresql
PGDATABASE: ${DBNAME:-prod}
CUSTOM_CONF_DIR: "/opt/odoo/custom/conf-test.d"
depends_on:
- postgresql
volumes:
Expand Down
1 change: 1 addition & 0 deletions tests/scaffoldings/dotd_ge_16/custom/conf.d/conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[conf]
1 change: 1 addition & 0 deletions tests/scaffoldings/dotd_ge_16/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
PGPASSWORD: anotherodoopassword
PGHOST: postgresql
PGDATABASE: ${DBNAME:-prod}
CUSTOM_CONF_DIR: "/opt/odoo/custom/conf-test.d"
depends_on:
- postgresql
volumes:
Expand Down
Loading