Skip to content

Commit 7b28ee7

Browse files
authored
Merge pull request #25 from kekru/dev
Exit script on failure
2 parents 93f2067 + 78c8d61 commit 7b28ee7

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

resources/create-certs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/sh
22
#see https://docs.docker.com/engine/security/https/
3+
set -e
4+
5+
if [ "$DEBUG" = "true" ]; then
6+
set -x
7+
fi
38

49
EXPIRATIONDAYS=700
510
CASUBJSTRING="/C=GB/ST=London/L=London/O=ExampleCompany/OU=IT/CN=example.com/emailAddress=test@example.com"

resources/entrypoint.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#!/bin/sh
2+
set -e
3+
4+
if [ "$DEBUG" = "true" ]; then
5+
set -x
6+
fi
27

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

8-
if [ -n $CREATE_CERTS_WITH_PW ]; then
13+
if [ -n "$CREATE_CERTS_WITH_PW" ]; then
914
if [ -z "$(ls -A $CERTS_DIR)" ]; then
1015

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

2732
echo "$CERTS_DIR is not empty. Not creating certs."
2833
fi
34+
35+
else
36+
echo "CREATE_CERTS_WITH_PW is not set. Not creating certs."
2937
fi

0 commit comments

Comments
 (0)