pg_create_user: extracts more environment variables
parent
f53db2c6cc
commit
134da2dea4
|
@ -10,4 +10,4 @@ consumes: postgresql
|
||||||
name: gitea database creation
|
name: gitea database creation
|
||||||
# 'command' is run only if this directory doesn't exist
|
# 'command' is run only if this directory doesn't exist
|
||||||
unless-file: ${SERVICE_ROOT}/db_is_setup
|
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}
|
: ${PGUSER:=postgres}
|
||||||
|
|
||||||
# TODO: add default postgresql port
|
# TODO: add default postgresql port
|
||||||
: ${pgport}
|
: ${pgport:=$(get-port $POSTGRESQL_PROVIDER)}
|
||||||
: ${dbname}
|
|
||||||
|
: ${PGDATA:=$POSTGRESQL_ROOT}
|
||||||
|
: ${dbuser:=${SERVICE_ID//\//_}}
|
||||||
|
: ${dbpassfile:=${SERVICE_ROOT+$SERVICE_ROOT/password_main}}
|
||||||
|
: ${dbname:=${SERVICE_ID+${SERVICE_ID//\//_}_db}}
|
||||||
|
|
||||||
: ${command}
|
: ${command}
|
||||||
: ${cmdparameters}
|
: ${cmdparameters}
|
||||||
|
@ -124,6 +128,8 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export PGDATA PGHOST PGUSER
|
||||||
|
|
||||||
if [ -z $simulation ]
|
if [ -z $simulation ]
|
||||||
then
|
then
|
||||||
case ${command} in
|
case ${command} in
|
||||||
|
|
Loading…
Reference in New Issue