From b6ce81427937333d9ae94cedd3ef0f81765e02ee Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Tue, 20 Jun 2017 00:30:06 +0300 Subject: [PATCH] refactor(aio): enable `-u` flag on preview server scripts --- aio/aio-builds-setup/dockerbuild/scripts-sh/clean-up.sh | 2 +- aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh | 3 ++- aio/aio-builds-setup/dockerbuild/scripts-sh/init.sh | 2 +- .../dockerbuild/scripts-sh/upload-server-prod.sh | 2 +- .../dockerbuild/scripts-sh/upload-server-test.sh | 3 +-- aio/aio-builds-setup/dockerbuild/scripts-sh/verify-setup.sh | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/clean-up.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/clean-up.sh index 18189629c3..951f88f1c1 100755 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/clean-up.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/clean-up.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail # Set up env variables export AIO_GITHUB_TOKEN=$(head -c -1 /aio-secrets/GITHUB_TOKEN 2>/dev/null) diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh index de08632ace..d61ddada65 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/health-check.sh @@ -1,5 +1,6 @@ #!/bin/bash -set +e -o pipefail +# Using `+e` so that all checks are run and we get a complete report (even if some checks failed). +set +e -u -o pipefail # Variables diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/init.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/init.sh index 7162b9223b..9e888e0c3d 100755 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/init.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/init.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail exec >> /var/log/aio/init.log exec 2>&1 diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-prod.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-prod.sh index b660d2da5c..b5c066a886 100755 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-prod.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-prod.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail # Set up env variables for production export AIO_GITHUB_TOKEN=$(head -c -1 /aio-secrets/GITHUB_TOKEN 2>/dev/null) diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-test.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-test.sh index 01da648eed..87e1202a31 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-test.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/upload-server-test.sh @@ -1,12 +1,11 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail # Set up env variables for testing export AIO_BUILDS_DIR=$TEST_AIO_BUILDS_DIR export AIO_DOMAIN_NAME=$TEST_AIO_DOMAIN_NAME export AIO_GITHUB_ORGANIZATION=$TEST_AIO_GITHUB_ORGANIZATION export AIO_GITHUB_TEAM_SLUGS=$TEST_AIO_GITHUB_TEAM_SLUGS -export AIO_PREVIEW_DEPLOYMENT_TOKEN=$TEST_AIO_PREVIEW_DEPLOYMENT_TOKEN export AIO_REPO_SLUG=$TEST_AIO_REPO_SLUG export AIO_TRUSTED_PR_LABEL=$TEST_AIO_TRUSTED_PR_LABEL export AIO_UPLOAD_HOSTNAME=$TEST_AIO_UPLOAD_HOSTNAME diff --git a/aio/aio-builds-setup/dockerbuild/scripts-sh/verify-setup.sh b/aio/aio-builds-setup/dockerbuild/scripts-sh/verify-setup.sh index ccb4e43a01..0011d7fcd9 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-sh/verify-setup.sh +++ b/aio/aio-builds-setup/dockerbuild/scripts-sh/verify-setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -e -o pipefail +set -eu -o pipefail logFile=/var/log/aio/verify-setup.log uploadServerLogFile=/var/log/aio/upload-server-verify-setup.log