pg_create_user: extracts more environment variables
This commit is contained in:
parent
f53db2c6cc
commit
134da2dea4
@ -10,4 +10,4 @@ consumes: postgresql
|
||||
name: gitea database creation
|
||||
# 'command' is run only if this directory doesn't exist
|
||||
unless-file: ${SERVICE_ROOT}/db_is_setup
|
||||
command: pg_create_user.sh --pghost=localhost --pgport=$(get-port $POSTGRESQL_PROVIDER) --pgdatadir=$POSTGRESQL_ROOT --pguser=postgres --dbuser=${ENVIRONMENT}_gitea --dbpassfile=${SERVICE_ROOT}/password_main --dbname=${ENVIRONMENT}_gitea_db create_user_and_db && touch ${SERVICE_ROOT}/db_is_setup
|
||||
command: pg_create_user.sh create_user_and_db && touch ${SERVICE_ROOT}/db_is_setup
|
||||
|
@ -4,8 +4,12 @@
|
||||
: ${PGUSER:=postgres}
|
||||
|
||||
# TODO: add default postgresql port
|
||||
: ${pgport}
|
||||
: ${dbname}
|
||||
: ${pgport:=$(get-port $POSTGRESQL_PROVIDER)}
|
||||
|
||||
: ${PGDATA:=$POSTGRESQL_ROOT}
|
||||
: ${dbuser:=${SERVICE_ID//\//_}}
|
||||
: ${dbpassfile:=${SERVICE_ROOT+$SERVICE_ROOT/password_main}}
|
||||
: ${dbname:=${SERVICE_ID+${SERVICE_ID//\//_}_db}}
|
||||
|
||||
: ${command}
|
||||
: ${cmdparameters}
|
||||
@ -124,6 +128,8 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export PGDATA PGHOST PGUSER
|
||||
|
||||
if [ -z $simulation ]
|
||||
then
|
||||
case ${command} in
|
||||
|
Loading…
Reference in New Issue
Block a user