update tf to 0.10.2 and enable autodeploy on staging

parent f0147a53
......@@ -19,20 +19,14 @@ tf_validate:
TF_VERSION="$(cat "${env}/.terraform_version")"
export TF_VERSION
make tfinstall
if echo "$TF_VERSION" | grep -q '\.9\.'; then
# terraform version 0.9.x doesn't support
# the check-variables options but will pass
# with unset vars
tf_opts=""
else
tf_opts="-check-variables=false"
fi
tf_opts="-check-variables=false"
(
/terraform init -backend=false
dirs_to_check=$(find modules "$env" -name "*.tf" -type f -exec dirname {} \; | sort | uniq)
/bin/sh -e -c 'for d in $1; do echo "Checking $d for $0" && /terraform validate $2 "$d"; done' "$env" "$dirs_to_check" "$tf_opts"
)
done
staging_tf_plan:
stage: planning
environment:
......@@ -43,12 +37,12 @@ staging_tf_plan:
except:
- master
#staging_tf_apply:
# stage: deployment
# environment:
# name: staging
# script:
# - TF_VERSION="$(cat environments/staging/.terraform_version)" make tfinstall
# - cd environments/staging && /terraform init -input=false -backend-config="bucket=${STATE_S3_BUCKET}" -backend-config="key=${STATE_S3_KEY}" -backend-config="region=${STATE_S3_REGION}" && /terraform apply -input=false
# only:
# - master
staging_tf_apply:
stage: deployment
environment:
name: staging
script:
- TF_VERSION="$(cat environments/staging/.terraform_version)" make tfinstall
- cd environments/staging && /terraform init -input=false -backend-config="bucket=${STATE_S3_BUCKET}" -backend-config="key=${STATE_S3_KEY}" -backend-config="region=${STATE_S3_REGION}" && /terraform apply -input=false
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment