Browse Source

new: [monujo] make relation to ``odoo-server`` optional

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
new-monujo-options
Valentin Lab 3 years ago
parent
commit
956d3d17e2
  1. 4
      monujo/hooks/pre_deploy
  2. 2
      monujo/metadata.yml

4
monujo/hooks/pre_deploy

@ -5,6 +5,7 @@
set -e set -e
if service:traverse "${SERVICE_NAME}":odoo-server >/dev/null; then
if ! url=$(relation:get "${SERVICE_NAME}":odoo-server:web-proxy url); then if ! url=$(relation:get "${SERVICE_NAME}":odoo-server:web-proxy url); then
err "Monujo doesn't support odoo-server not having a web-proxy yet." err "Monujo doesn't support odoo-server not having a web-proxy yet."
exit 1 exit 1
@ -13,11 +14,12 @@ if ! dbname=$(relation:get "${SERVICE_NAME}":odoo-server:postgres-database dbnam
err "Can't find db name of our odoo-server relation." err "Can't find db name of our odoo-server relation."
exit 1 exit 1
fi fi
monujo:config_merge "{ monujo:config_merge "{
\"lokapiHost\": \"$url\", \"lokapiHost\": \"$url\",
\"lokapiDb\": \"$dbname\" \"lokapiDb\": \"$dbname\"
}" }"
fi
if map_url=$(relation:get "${SERVICE_NAME}":map-server:publish-dir url); then if map_url=$(relation:get "${SERVICE_NAME}":map-server:publish-dir url); then

2
monujo/metadata.yml

@ -18,7 +18,7 @@ uses:
odoo-server: odoo-server:
#constraint: required | recommended | optional #constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair #auto: pair | summon | none ## default: pair
constraint: required
constraint: optional
auto: pair auto: pair
solves: solves:
container: "LCC API provider" container: "LCC API provider"

Loading…
Cancel
Save