Last active
June 19, 2018 18:01
-
-
Save limed/0b7262243fa76d2768f59249c1e2c65d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nubis/files/nubis-ci-deploy b/nubis/files/nubis-ci-deploy | |
index 3e14338..77282a7 100755 | |
--- a/nubis/files/nubis-ci-deploy | |
+++ b/nubis/files/nubis-ci-deploy | |
@@ -7,6 +7,9 @@ declare environment | |
declare service_name | |
declare TF_CONSUL_WORKAROUND | |
+# We are skipping builds | |
+SKIP_BUILD=$(jq -r '.variables.skip_build' nubis/builder/project.json) | |
+ | |
cleanup () { | |
if [ ! -z "$TF_CONSUL_WORKAROUND" ]; then | |
rm -f "$TF_CONSUL_WORKAROUND" 2>/dev/null | |
@@ -36,7 +39,13 @@ else | |
exit 1 | |
fi | |
-echo "Deploying AMI $ami into $environment/$region ($action)" | |
+if [ ! -z "${SKIP_BUILD}" ] && [ "${SKIP_BUILD}" == "true" ]; then | |
+ echo "Deploying into $environment/$region ($action)" | |
+ terraform_ami_arg="" | |
+else | |
+ echo "Deploying AMI $ami into $environment/$region ($action)" | |
+ terraform_ami_arg="-var ami="$ami"" | |
+fi | |
VARIABLES=$WORKSPACE/../vars.tfvars | |
@@ -68,7 +77,7 @@ if [ -d artifacts/terraform ]; then | |
-var region="$region" \ | |
-var environment="$environment" \ | |
-var service_name="$service_name" \ | |
- -var ami="$ami" \ | |
+ $terraform_ami_arg \ | |
$terraform_extra_args \ | |
artifacts/terraform |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment