Skip to content

Instantly share code, notes, and snippets.

@timhberry
Created July 15, 2018 20:40
Show Gist options
  • Save timhberry/e429744f7bf8fe56b578738602981e7e to your computer and use it in GitHub Desktop.
Save timhberry/e429744f7bf8fe56b578738602981e7e to your computer and use it in GitHub Desktop.
.gitlab-ci.yml
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