Skip to content

Commit

Permalink
Merge pull request hashicorp#21 from hashicorp/add-circleci
Browse files Browse the repository at this point in the history
add CircleCI test
  • Loading branch information
rberlind authored Mar 15, 2021
2 parents 1dc87e3 + 1246a0c commit 44b9751
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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

0 comments on commit 44b9751

Please sign in to comment.