Skip to content

Commit 5b8e75c

Browse files
committed
Add CircleCI config
1 parent f6393c2 commit 5b8e75c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.circleci/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
3+
jobs:
4+
build:
5+
docker:
6+
- image: hashicorp/terraform:0.11.2
7+
entrypoint: /bin/sh
8+
steps:
9+
- checkout
10+
- run:
11+
name: Validate tf files (terraform validate)
12+
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
13+
- run:
14+
name: check if all tf files are formatted (terraform fmt)
15+
command: if [ `terraform fmt | wc -c` -ne 0 ]; then echo "Some terraform files need be formatted, run 'terraform fmt' to fix"; exit 1; fi
16+
- run:
17+
name: "Install: tflint"
18+
command: |
19+
apk add wget
20+
wget https://github.com/wata727/tflint/releases/download/v0.5.4/tflint_linux_amd64.zip
21+
unzip tflint_linux_amd64.zip
22+
mkdir -p /usr/local/tflint/bin
23+
export PATH=/usr/local/tflint/bin:$PATH
24+
install tflint /usr/local/tflint/bin
25+
- run:
26+
name: "tflint check"
27+
command: /usr/local/tflint/bin/tflint
28+
29+
workflows:
30+
version: 2
31+
build:
32+
jobs:
33+
- build

0 commit comments

Comments
 (0)