Browse Source

new: [odoo-tecnativa] added 'database' option to charm.

Not sure this one is a good idea.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
lokavaluto/dev/master
Valentin Lab 5 years ago
parent
commit
227a7adc95
  1. 19
      odoo-tecnativa/hooks/postgres_database-relation-joined

19
odoo-tecnativa/hooks/postgres_database-relation-joined

@ -22,23 +22,24 @@ ADMIN_PASSWORD=$(relation-base-compose-get admin-password 2>/dev/null) || {
fi
}
control=$(echo -en "$USER\0$DBNAME\0$PASSWORD\0$ADMIN_PASSWORD" | md5_compat)
database=$(options-get database 2>/dev/null) || true
database="${database:-$DBNAME}"
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
command:
- '--database=$DBNAME'
## All this is to please technativa image, but is quite redundant
- '--database=$database'
## All this is to please tecnativa image, but is quite redundant
environment:
PGHOST: $MASTER_TARGET_SERVICE_NAME
PGDATABASE: $DBNAME
PGPASSWORD: $PASSWORD
PGUSER: $USER
PGHOST: \"$MASTER_TARGET_SERVICE_NAME\"
PGDATABASE: \"$DBNAME\"
PGPASSWORD: \"$PASSWORD\"
PGUSER: \"$USER\"
#DBFILTER: $DBNAME
ADMIN_PASSWORD: $ADMIN_PASSWORD
ADMIN_PASSWORD: \"$ADMIN_PASSWORD\"
"
[ "$control" == "$(relation-get control 2>/dev/null)" ] && exit 0

Loading…
Cancel
Save