Initialize a db with only the base module

This commit is contained in:
Stéphane Bidoul 2023-06-27 16:51:33 +02:00
parent aca17a06f5
commit 7679473acd
3 changed files with 13 additions and 3 deletions

View file

@ -3,3 +3,4 @@
set -ex
dropdb --if-exists --force $PGDATABASE
dropdb --if-exists --force $PGDATABASE-baseonly

View file

@ -12,12 +12,23 @@ oca_wait_for_postgres
# Drop database, in case we are reinitializing.
dropdb --if-exists $PGDATABASE
dropdb --if-exists $PGDATABASE-baseonly
ADDONS=$(manifestoo --select-addons-dir ${ADDONS_DIR} --select-include "${INCLUDE}" --select-exclude "${EXCLUDE}" list --separator=,)
# Create the baseonly database.
unbuffer $(which odoo || which openerp-server) \
--data-dir=/mnt/data/odoo-data-dir \
--db-template=template1 \
-d ${PGDATABASE}-baseonly \
-i base \
--stop-after-init
# Try to install all addons, but do not fail in case of error, to let the build start
# so users can work with the 'baseonly' database.
unbuffer $(which odoo || which openerp-server) \
--data-dir=/mnt/data/odoo-data-dir \
--db-template=template1 \
-d ${PGDATABASE} \
-i ${ADDONS:-base} \
--stop-after-init
--stop-after-init || exit 0

View file

@ -35,8 +35,6 @@ oca_wait_for_postgres
# --db_user is necessary for Odoo <= 10
unbuffer $(which odoo || which openerp-server) \
--data-dir=/mnt/data/odoo-data-dir \
--no-database-list \
--database ${PGDATABASE} \
--db-filter=^${PGDATABASE} \
--db_user=${PGUSER} \
--smtp=localhost \