Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions with-terraform/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
fmt:
terraform fmt
#!/usr/bin/env -- make -f
########################################

plan:
terraform plan
TF := $(command -v terraform)
TFLINT := $(command -v tflint)
TF_OPTS :=
TFLINT_OPTS :=

apply:
terraform apply
########################################
.DEFAULT: help
PHONY: all help fmt init plan apply

help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

deps: init ## install plugins and providers

all: deps fmt plan ## install dependancies then format and execute 'terraform plan'

lint: fmt ## format hcl files and run the linter
$(TFLINT) $(TFLINT_OPTS) .

init fmt plan apply: ## default rule to execute terrafrom sub commands
$(TF) $(TF_OPTS) $@