From 9f315d37968f0135deb3fadcdf6cf54278153de0 Mon Sep 17 00:00:00 2001 From: Varac Date: Thu, 29 Jun 2017 16:20:30 +0200 Subject: [CI] Check for mandatory env variables on platform builds --- tests/platform-ci/ci-build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/platform-ci/ci-build.sh b/tests/platform-ci/ci-build.sh index 34876a73..e2485c0a 100755 --- a/tests/platform-ci/ci-build.sh +++ b/tests/platform-ci/ci-build.sh @@ -54,6 +54,11 @@ else } fi +fail() { + echo "$*" + exit 1 +} + deploy() { LEAP_CMD deploy "$TAG" } @@ -73,6 +78,11 @@ build_from_scratch() { # Dsiable xtrace set +x + + [ -z "$AWS_ACCESS_KEY" ] && fail "\$AWS_ACCESS_KEY is not set - please provide it as env variable." + [ -z "$AWS_SECRET_KEY" ] && fail "\$AWS_SECRET_KEY is not set - please provide it as env variable." + [ -z "$SSH_PRIVATE_KEY" ] && fail "\$SSH_PRIVATE_KEY is not set - please provide it as env variable." + /usr/bin/jq ".platform_ci.auth |= .+ {\"aws_access_key_id\":\"$AWS_ACCESS_KEY\", \"aws_secret_access_key\":\"$AWS_SECRET_KEY\"}" < cloud.json.template > cloud.json # Enable xtrace again only if it was set at beginning of script [[ $xtrace == true ]] && set -x -- cgit v1.2.3