-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added circleci config, copied from cloud-platform-infra (#16)
- Loading branch information
1 parent
73cff2e
commit da63b58
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|