-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
33 lines (26 loc) · 873 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PROJECT := terraform-google-secure
GO_BIN := $(shell go env GOPATH)/bin
TFLINT := $(GO_BIN)/tflint
DOCKER ?= docker
SHELL := /bin/bash
$(TFLINT): export TMPDIR = $(shell mktemp -d)
$(TFLINT):
curl -sL https://github.com/terraform-linters/tflint/releases/latest/download/tflint_$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH).zip -o $${TMPDIR}/tflint.zip
unzip $${TMPDIR}/tflint.zip -d $(GO_BIN) tflint
rm -rf $${TMPDIR}
deps: $(TFLINT)
go install github.com/terraform-docs/[email protected]
go install github.com/hashicorp/terraform-config-inspect@latest
lint: $(TFLINT)
$(MAKE) -C modules lint
fmt-check: fmt
fmt:
terraform fmt -check -recursive modules
fmt-fix:
terraform fmt -recursive modules
clean:
find -name ".terraform" -type d | xargs rm -rf
find -name ".terraform.lock.hcl" -type f | xargs rm -f
.PHONY: test
test:
$(MAKE) -C test test