Browse Source

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

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

24
monujo/hooks/pre_deploy

@ -5,19 +5,21 @@
set -e
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."
exit 1
fi
if ! dbname=$(relation:get "${SERVICE_NAME}":odoo-server:postgres-database dbname); then
err "Can't find db name of our odoo-server relation."
exit 1
if service:traverse "${SERVICE_NAME}":odoo-server >/dev/null; 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."
exit 1
fi
if ! dbname=$(relation:get "${SERVICE_NAME}":odoo-server:postgres-database dbname); then
err "Can't find db name of our odoo-server relation."
exit 1
fi
monujo:config_merge "{
\"lokapiHost\": \"$url\",
\"lokapiDb\": \"$dbname\"
}"
fi
monujo:config_merge "{
\"lokapiHost\": \"$url\",
\"lokapiDb\": \"$dbname\"
}"
if map_url=$(relation:get "${SERVICE_NAME}":map-server:publish-dir url); then

2
monujo/metadata.yml

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

Loading…
Cancel
Save