Skip to content

Instantly share code, notes, and snippets.

@greyhoundforty
Created January 14, 2020 16:42
Show Gist options
  • Save greyhoundforty/8d8227fd8b7e8450bc596b12f719a4be to your computer and use it in GitHub Desktop.
Save greyhoundforty/8d8227fd8b7e8450bc596b12f719a4be to your computer and use it in GitHub Desktop.
GitLab CI/CD example for IBM Cloud Terraform
image:
name: ibmterraform/terraform-provider-ibm-docker
entrypoint:
- '/usr/bin/env'
- 'PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
before_script:
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment