-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
31 lines (24 loc) · 1.24 KB
/
GNUmakefile
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
DEV_DIR:=./terraform
default: devcheck
fmt:
@echo "==> Formatting Terraform code with terraform fmt..."
@command -v terraform >/dev/null 2>&1 || { echo >&2 "'terraform' is required but not installed. Aborting."; exit 1; }
@terraform fmt -recursive .
fmt-check:
@echo "==> Checking Terraform code with terraform fmt..."
@command -v terraform >/dev/null 2>&1 || { echo >&2 "'terraform' is required but not installed. Aborting."; exit 1; }
@terraform fmt -recursive -check .
tflint:
@echo "==> Checking Terraform code with tflint..."
@command -v tflint >/dev/null 2>&1 || { echo >&2 "'tflint' is required but not installed. Aborting."; exit 1; }
@tflint --recursive
validate:
@echo "==> Validating Terraform code with terraform validate..."
@command -v terraform >/dev/null 2>&1 || { echo >&2 "'terraform' is required but not installed. Aborting."; exit 1; }
@terraform -chdir=$(DEV_DIR) validate
trivy:
@echo "==> Checking Terraform code with trivy..."
@command -v trivy >/dev/null 2>&1 || { echo >&2 "'trivy' is required but not installed. Aborting."; exit 1; }
@TF_VAR_pingone_environment_name=$(git rev-parse --abbrev-ref HEAD) trivy config ./
devcheck: fmt fmt-check validate tflint trivy
.PHONY: devcheck fmt fmt-check validate tflint trivy