Forked from timhberry/gist:e429744f7bf8fe56b578738602981e7e
Created
April 8, 2019 14:20
-
-
Save atrakic/5a3a5bc974c98ab1b71dd69eee0e5856 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