-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
38 lines (29 loc) · 1.25 KB
/
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
34
35
36
37
38
.PHONY: all install-tools validate fmt docs test test-parallel test-sequential
all: install-tools validate fmt docs
install-tools:
go install github.com/terraform-docs/terraform-docs@latest
TEST_ARGS := $(if $(skip-destroy),-skip-destroy=$(skip-destroy)) \
$(if $(exception),-exception=$(exception)) \
$(if $(example),-example=$(example))
test:
cd tests && go test -v -timeout 60m -run '^TestApplyNoError$$' -args $(TEST_ARGS) .
test-sequential:
cd tests && go test -v -timeout 120m -run '^TestApplyAllSequential$$' -args $(TEST_ARGS) .
test-parallel:
cd tests && go test -v -timeout 60m -run '^TestApplyAllParallel$$' -args $(TEST_ARGS) .
docs:
@echo "Generating documentation for root and modules..."
terraform-docs markdown . --output-file README.md --output-mode inject --hide modules
for dir in modules/*; do \
if [ -d "$$dir" ]; then \
echo "Processing $$dir..."; \
terraform-docs markdown "$$dir" --output-file "$$dir/README.md" --output-mode inject --hide modules || echo "Skipped: $$dir"; \
fi \
done
fmt:
terraform fmt -recursive
validate:
terraform init -backend=false
terraform validate
@echo "Cleaning up initialization files..."
rm -rf .terraform terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl