You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
765 B

  1. #!/bin/bash
  2. ## Should be executable N time in a row with same result.
  3. . lib/common
  4. set -e
  5. if service:traverse "${SERVICE_NAME}":odoo-server >/dev/null; then
  6. if ! url=$(relation:get "${SERVICE_NAME}":odoo-server:web-proxy url); then
  7. err "Monujo doesn't support odoo-server not having a web-proxy yet."
  8. exit 1
  9. fi
  10. if ! dbname=$(relation:get "${SERVICE_NAME}":odoo-server:postgres-database dbname); then
  11. err "Can't find db name of our odoo-server relation."
  12. exit 1
  13. fi
  14. monujo:config_merge "{
  15. \"lokapiHost\": \"$url\",
  16. \"lokapiDb\": \"$dbname\"
  17. }"
  18. fi
  19. if map_url=$(relation:get "${SERVICE_NAME}":map-server:publish-dir url); then
  20. monujo:config_merge "{
  21. \"mapUrl\": \"$map_url\"
  22. }"
  23. fi