Skip to content

Instantly share code, notes, and snippets.

@davehowell
Created September 1, 2021 04:09
Show Gist options
  • Select an option

  • Save davehowell/a43f04dacbdce453ab46be379e7c5fb8 to your computer and use it in GitHub Desktop.

Select an option

Save davehowell/a43f04dacbdce453ab46be379e7c5fb8 to your computer and use it in GitHub Desktop.
cicd
version: 2
jobs:
terraform-validate:
docker:
- image: docker.mirror.hashicorp.services/hashicorp/terraform:light
steps:
- checkout
- run:
name: Terraform Validate
command: |
terraform init
terraform validate
# terraform-plan:
# docker:
# - image: docker.mirror.hashicorp.services/hashicorp/terraform:light
# steps:
# - checkout
# - run:
# name: Terraform Validate
# command: |
# terraform init
# terraform plan
# terraform-apply:
# docker:
# - image: docker.mirror.hashicorp.services/hashicorp/terraform:light
# steps:
# - checkout
# - run:
# name: Terraform Apply
# command: |
# terraform init
# terraform apply -auto-approve
# - persist_to_workspace:
# root: /root
# paths:
# - project
# run-inspec-tests:
# docker:
# - image: docker.mirror.hashicorp.services/chef/inspec:latest
# steps:
# - attach_workspace:
# at: ~/
# - run:
# name: Inspec Tests
# command: |
# inspec --version
# - persist_to_workspace:
# root: /root
# paths:
# - project
# terraform-destroy:
# docker:
# - image: docker.mirror.hashicorp.services/hashicorp/terraform:light
# steps:
# - attach_workspace:
# at: ~/
# - run:
# name: Terraform Destroy
# command: |
# terraform destroy -auto-approve
workflows:
version: 2
infrastructure-tests:
jobs:
- terraform-validate
# - terraform-plan:
# requires:
# - terraform-validate
# - terraform-apply:
# requires:
# - terraform-plan
# - run-inspec-tests:
# requires:
# - terraform-apply
# - terraform-destroy:
# requires:
# - run-inspec-tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment