get a deployment going
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cellarspoon
2022-01-10 14:22:33 +01:00
parent f9061e2ecf
commit befbcd064d
4 changed files with 120 additions and 2 deletions

30
entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,30 @@
#! /bin/bash
set -eu
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "KEYCLOAK_CLIENT_SECRET"
file_env "APP_SECRET_KEY"
echo "Passing it back to the upstream ENTRYPOINT/CMD..."
exec "$@"