fix wait-for conditions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-02-04 10:36:27 +01:00
parent 9aa5146488
commit 3390ad995b
2 changed files with 10 additions and 9 deletions

View File

@ -31,6 +31,6 @@ USER app
STOPSIGNAL SIGTERM
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint"]
WORKDIR /app
CMD []

View File

@ -12,23 +12,24 @@ fi
if [ -n "$BITWARDENRS_LDAP_BITWARDEN_URL" ]
then
WAITFOR_DB_SCHEME=$(/usr/local/bin/url-parser scheme --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
WAITFOR_DB_HOST=$(/usr/local/bin/url-parser host --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
WAITFOR_DB_PORT=$(/usr/local/bin/url-parser port --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
WAITFOR_BW_SCHEME=$(/usr/local/bin/url-parser scheme --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
WAITFOR_BW_HOST=$(/usr/local/bin/url-parser host --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
WAITFOR_BW_PORT=$(/usr/local/bin/url-parser port --url "$BITWARDENRS_LDAP_BITWARDEN_URL")
if [ -n "$WAITFOR_DB_PORT" ]
if [ -z "$WAITFOR_BW_PORT" ]
then
[ "$WAITFOR_DB_SCHEME" = "https" ] && WAITFOR_DB_PORT=433 || WAITFOR_DB_PORT=80
[ "$WAITFOR_BW_SCHEME" = "https" ] && WAITFOR_BW_PORT=433 || WAITFOR_BW_PORT=80
fi
printf "Wait for bitwarden server on '%s:%s'...\n" "${WAITFOR_DB_HOST}" "${WAITFOR_DB_PORT}"
/usr/local/bin/wait-for "${WAITFOR_DB_HOST}":"${WAITFOR_DB_PORT}"
printf "Wait for bitwarden server on '%s:%s'...\n" "${WAITFOR_BW_HOST}" "${WAITFOR_BW_PORT}"
/usr/local/bin/wait-for "${WAITFOR_BW_HOST}":"${WAITFOR_BW_PORT}"
fi
if [ -n "$BITWARDENRS_LDAP_HOST" ]
then
WAITFOR_LDAP_SSL=$(/usr/local/bin/gomplate -i '{{ getenv "BITWARDENRS_LDAP_SSL" "true" | conv.Bool }}')
if [ -n "$WAITFOR_LDAP_PORT" ]
if [ -z "$WAITFOR_LDAP_PORT" ]
then
[ "$WAITFOR_LDAP_SSL" = true ] && WAITFOR_LDAP_PORT=636 || WAITFOR_LDAP_PORT=389
fi