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.

22 lines
443 B

  1. #!/bin/bash
  2. set -e
  3. PASSWORD="$(relation-get password)"
  4. USER="$(relation-get user)"
  5. DBNAME="$(relation-get dbname)"
  6. HOST="$(relation-get host)"
  7. PORT="$(relation-get port)"
  8. config-add "\
  9. services:
  10. $MASTER_BASE_SERVICE_NAME:
  11. environment:
  12. DB_HOST: \"$HOST\"
  13. DB_PORT: \"$PORT\"
  14. DB_NAME: \"$DBNAME\"
  15. DB_USER: \"$USER\"
  16. DB_PASSWORD: \"$PASSWORD\"
  17. "
  18. info "Configured $SERVICE_NAME code for $HOST:$PORT access."