Skip to content

Commit

Permalink
added circleci config, copied from cloud-platform-infra (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrbls authored and razvan-moj-zz committed Mar 25, 2019
1 parent 73cff2e commit da63b58
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# based on: https://github.com/terraform-aws-modules/terraform-aws-vpc/blob/master/.circleci/config.yml
version: 2

terraform: &terraform
docker:
- image: hashicorp/terraform:light
working_directory: /tmp/workspace/terraform

jobs:
validate:
<<: *terraform
steps:
- checkout
- run:
name: change to terraform directory
command: cd terraform
- run:
name: Validate Terraform configurations
command: find . -type f -name "*.tf" -exec dirname {} \;|sort -u | while read m; do (terraform validate -check-variables=false "$m" && echo "√ $m") || exit 1 ; done
- run:
name: Check if Terraform configurations are properly formatted
command: tf=$(terraform fmt -write=false -diff); if [[ -n "$tf" ]]; then printf "$tf\n\n\nSome terraform files failed syntax validation, run 'terraform fmt' to fix\n\n"; exit 1; fi
- persist_to_workspace:
root: .
paths: .

workflows:
version: 2
build:
jobs:
- validate

0 comments on commit da63b58

Please sign in to comment.