summaryrefslogtreecommitdiff
path: root/tests/platform-ci
diff options
context:
space:
mode:
authorVarac <varac@leap.se>2017-06-29 16:20:30 +0200
committerVarac <varac@leap.se>2017-06-30 17:30:37 +0200
commit9f315d37968f0135deb3fadcdf6cf54278153de0 (patch)
tree65ac581d26d6c131245703739f174cedda548bd6 /tests/platform-ci
parent30a4bc4eba4654de8e5bd56a083a78b474a2a6ff (diff)
[CI] Check for mandatory env variables on platform builds
Diffstat (limited to 'tests/platform-ci')
-rwxr-xr-xtests/platform-ci/ci-build.sh10
1 files changed, 10 insertions, 0 deletions
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