Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit a009066

Browse files
committed
Update CI build versions. Add pre-commit.
1 parent 654dc08 commit a009066

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.circleci/config.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@ workspace_root: &workspace_root /go/src/github.com/hashicorp/terraform-aws-consu
44
defaults: &defaults
55
working_directory: *workspace_root
66
docker:
7-
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.13
7+
- image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:tf13
88

99
version: 2
1010
jobs:
11-
validate_terraform:
12-
docker:
13-
- image: hashicorp/terraform
14-
steps:
15-
- checkout
16-
- run:
17-
name: Validate Terraform Formatting
18-
command: '[ -z "$(terraform fmt -write=false)" ] || { terraform fmt -write=false -diff; exit 1; }'
19-
2011
test:
2112
<<: *defaults
2213
steps:
2314
- checkout
2415
- run: echo 'export PATH=$HOME/terraform:$HOME/packer:$PATH' >> $BASH_ENV
2516
- attach_workspace:
2617
at: *workspace_root
18+
- run:
19+
# Fail the build if the pre-commit hooks don't pass. Note: if you run $ pre-commit install locally within this repo, these hooks will
20+
# execute automatically every time before you commit, ensuring the build never fails at this step!
21+
name: run pre-commit hooks
22+
command: |
23+
pip install pre-commit==1.21.0 cfgv==2.0.1
24+
pre-commit install
25+
pre-commit run --all-files
2726
- run:
2827
command: |
2928
mkdir -p /tmp/logs

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/gruntwork-io/pre-commit
3+
rev: v0.1.10
4+
hooks:
5+
- id: terraform-fmt
6+
- id: gofmt

0 commit comments

Comments
 (0)