Skip to content

Commit

Permalink
Merge pull request #25 from kekru/dev
Browse files Browse the repository at this point in the history
Exit script on failure
  • Loading branch information
kekru authored Oct 19, 2024
2 parents 93f2067 + 78c8d61 commit 7b28ee7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions resources/create-certs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh
#see https://docs.docker.com/engine/security/https/
set -e

if [ "$DEBUG" = "true" ]; then
set -x
fi

EXPIRATIONDAYS=700
CASUBJSTRING="/C=GB/ST=London/L=London/O=ExampleCompany/OU=IT/CN=example.com/[email protected]"
Expand Down
10 changes: 9 additions & 1 deletion resources/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#!/bin/sh
set -e

if [ "$DEBUG" = "true" ]; then
set -x
fi

if [ -n "$CERTS_PASSWORD_FILE" ]; then
echo "Using cert password from $CERTS_PASSWORD_FILE"
CREATE_CERTS_WITH_PW="$(cat $CERTS_PASSWORD_FILE)"
fi

if [ -n $CREATE_CERTS_WITH_PW ]; then
if [ -n "$CREATE_CERTS_WITH_PW" ]; then
if [ -z "$(ls -A $CERTS_DIR)" ]; then

echo "Create CA cert"
Expand All @@ -26,4 +31,7 @@ if [ -n $CREATE_CERTS_WITH_PW ]; then

echo "$CERTS_DIR is not empty. Not creating certs."
fi

else
echo "CREATE_CERTS_WITH_PW is not set. Not creating certs."
fi

0 comments on commit 7b28ee7

Please sign in to comment.