Update sync.sh

Add SSLMATE_API_KEY_FILE environment variable for docker secrets.
This commit is contained in:
Andrew Hurley 2021-08-07 18:45:41 +10:00 committed by GitHub
parent cf3bbd95b8
commit db347e578a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,14 @@ if [ ! -x /usr/bin/sslmate ]; then
exit 1 exit 1
fi fi
if [ -n "$SSLMATE_API_KEY_FILE" ]; then
echo "Attemping to use sslmate api key secret"
if [ -f "$SSLMATE_API_KEY_FILE" ]; then
echo "Secret found. Setting as SSLMATE_API_KEY"
SSLMATE_API_KEY="$(< "$SSLMATE_API_KEY_FILE")"
fi
fi
if [ "x$SSLMATE_API_KEY" == "x" ]; then if [ "x$SSLMATE_API_KEY" == "x" ]; then
echo "Missing sslmate api key from environment. Variable name must be SSLMATE_API_KEY" echo "Missing sslmate api key from environment. Variable name must be SSLMATE_API_KEY"
exit 1 exit 1