From 6e39a3db1928668baf4f229ab76e6507a03f0fa5 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 23 May 2021 12:24:32 +0700 Subject: [PATCH] Improve makefile targets consistency --- Makefile | 15 ++++++++++++--- apps/Makefile | 2 +- infra/Makefile | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5d13e8e8..f84e0e1c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,17 @@ .POSIX: -default: run +default: apply -.PHONY: run -run: +.PHONY: metal +metal: make -C metal + +.PHONY: infra +infra: make -C infra + +.PHONY: apps +apps: make -C apps .PHONY: tools @@ -15,3 +21,6 @@ tools: .PHONY: docs docs: make -C docs + +.PHONY: apply +apply: metal infra apps diff --git a/apps/Makefile b/apps/Makefile index d2875fe5..331a9674 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -8,5 +8,5 @@ default: apply apply: kubectl apply --kustomize . -delete: +destroy: kubectl delete --kustomize . diff --git a/infra/Makefile b/infra/Makefile index 0dd3d934..80ee6306 100644 --- a/infra/Makefile +++ b/infra/Makefile @@ -3,7 +3,7 @@ TF_IN_AUTOMATION = true -default: init plan apply +default: init apply init: terraform init -input=false @@ -11,7 +11,7 @@ init: plan: terraform plan -input=false -out=/tmp/tfplan -apply: +apply: plan terraform apply -input=false /tmp/tfplan destroy: