Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Refactored as a fully fleshed out makefile #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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) $@