From 985495511f07f6f77cfa6da5a04e8dce9758ec96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 23 Jan 2024 21:08:45 +0100 Subject: [PATCH] chore: add makefile targets (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .gitignore | 1 + Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/.gitignore b/.gitignore index 10d0a4d4..55ce46ca 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ Session.vim .netrwhist .idea *manifest-tool +.tools diff --git a/Makefile b/Makefile index b43d0c56..aa63ca89 100644 --- a/Makefile +++ b/Makefile @@ -334,3 +334,43 @@ test-version: test-image-all .PHONY: clean clean: rm -rf $(OUTPUT_DIR) + +######### +# TOOLS # +######### + +TOOLS_DIR := $(PWD)/.tools +KIND := $(TOOLS_DIR)/kind +KIND_VERSION := v0.20.0 +TOOLS := $(KIND) + +$(KIND): + @echo Install kind... >&2 + @GOBIN=$(TOOLS_DIR) go install sigs.k8s.io/kind@$(KIND_VERSION) + +.PHONY: install-tools +install-tools: $(TOOLS) ## Install tools + +.PHONY: clean-tools +clean-tools: ## Remove installed tools + @echo Clean tools... >&2 + @rm -rf $(TOOLS_DIR) + +######## +# KIND # +######## + +KIND_IMAGE ?= kindest/node:v1.28.0 + +.PHONY: kind-cluster +kind-cluster: $(KIND) ## Create kind cluster + @echo Create kind cluster... >&2 + @$(KIND) create cluster --image $(KIND_IMAGE) --wait 1m + +######## +# HELP # +######## + +.PHONY: help +help: ## Shows the available commands + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}'