Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
@ -0,0 +1,18 @@
#!/bin/bash
set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
DB_VENDOR: postgres
DB_ADDR: \"$MASTER_TARGET_SERVICE_NAME\"
DB_DATABASE: \"$DBNAME\"
DB_PASSWORD: \"$PASSWORD\"
DB_USER: \"$USER\"
"
@ -12,3 +12,11 @@ uses:
proxy: "Public access"
default-options:
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:8080
postgres-database:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: required
auto: summon
solves:
database: "main storage"