Forked from timhberry/gist:e429744f7bf8fe56b578738602981e7e
Created
May 10, 2020 12:22
-
-
Save alexvlasov/56bf88080888fc0dd78366387ed3a236 to your computer and use it in GitHub Desktop.
.gitlab-ci.yml
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
image: | |
name: hashicorp/terraform:light | |
entrypoint: | |
- '/usr/bin/env' | |
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' | |
before_script: | |
- rm -rf .terraform | |
- terraform --version | |
- mkdir -p ./creds | |
- echo $SERVICEACCOUNT | base64 -d > ./creds/serviceaccount.json | |
- terraform init | |
stages: | |
- validate | |
- plan | |
- apply | |
validate: | |
stage: validate | |
script: | |
- terraform validate | |
plan: | |
stage: plan | |
script: | |
- terraform plan -out "planfile" | |
dependencies: | |
- validate | |
artifacts: | |
paths: | |
- planfile | |
apply: | |
stage: apply | |
script: | |
- terraform apply -input=false "planfile" | |
dependencies: | |
- plan | |
when: manual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment