From ada68dc5666550076495781831c9088510cc0f47 Mon Sep 17 00:00:00 2001 From: Daichi Sakaue Date: Thu, 10 Oct 2024 15:25:35 +0900 Subject: [PATCH] Install tools with aqua Signed-off-by: Daichi Sakaue --- Makefile | 13 ++++++------- aqua.yaml | 13 +++++++++++++ e2e/Makefile | 7 +++---- 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 aqua.yaml diff --git a/Makefile b/Makefile index c6c7b17..068a9a0 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ JQ_VERSION := 1.7.1 KIND_VERSION := 0.22.0 KUBECTL_VERSION := 1.29.3 KUSTOMIZE_VERSION := 5.3.0 -YQ_VERSION := 4.43.1 # Test tools CUSTOMCHECKER := $(TOOLS_DIR)/custom-checker @@ -18,7 +17,6 @@ KIND := $(TOOLS_DIR)/kind KUBECTL := $(TOOLS_DIR)/kubectl KUSTOMIZE := $(TOOLS_DIR)/kustomize STATICCHECK := $(TOOLS_DIR)/staticcheck -YQ := $(TOOLS_DIR)/yq .PHONY: all all: help @@ -30,7 +28,12 @@ help: ## Display this help @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) .PHONY: setup -setup: $(CUSTOMCHECKER) $(HELM_BINARY) $(KIND) $(JQ) $(KUBECTL) $(KUSTOMIZE) $(STATICCHECK) $(YQ) ## Install necessary tools +setup: $(CUSTOMCHECKER) $(HELM_BINARY) $(KIND) $(JQ) $(KUBECTL) $(KUSTOMIZE) $(STATICCHECK) ## Install necessary tools + if ! which aqua; then \ + echo 'setup needs aqua.'; \ + exit 1; \ + fi + aqua install -l $(HELM) repo add cilium https://helm.cilium.io/ $(HELM) repo update cilium @@ -63,10 +66,6 @@ $(KUSTOMIZE): $(STATICCHECK): GOBIN=$(TOOLS_DIR) go install honnef.co/go/tools/cmd/staticcheck@latest -$(YQ): - mkdir -p $(TOOLS_DIR) - wget -qO $@ https://github.com/mikefarah/yq/releases/download/v$(YQ_VERSION)/yq_linux_amd64 - chmod +x $@ .PHONY: clean clean: diff --git a/aqua.yaml b/aqua.yaml new file mode 100644 index 0000000..deaf6c2 --- /dev/null +++ b/aqua.yaml @@ -0,0 +1,13 @@ +--- +# aqua - Declarative CLI Version Manager +# https://aquaproj.github.io/ +# checksum: +# enabled: true +# require_checksum: true +# supported_envs: +# - all +registries: +- type: standard + ref: v4.231.0 # renovate: depName=aquaproj/aqua-registry +packages: +- name: mikefarah/yq@v4.44.3 diff --git a/e2e/Makefile b/e2e/Makefile index ced9aaa..33af733 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -9,7 +9,6 @@ HELM := $(TOOLS_DIR)/helm --repository-cache $(CACHE_DIR)/helm/repository --repo KIND := $(TOOLS_DIR)/kind KUBECTL := $(TOOLS_DIR)/kubectl KUSTOMIZE := $(TOOLS_DIR)/kustomize -YQ := $(TOOLS_DIR)/yq ##@ Basic @@ -38,9 +37,9 @@ start: run-test-pod-%: cat testdata/template/ubuntu.yaml | \ - $(YQ) '.metadata.name = "$*"' | \ - $(YQ) '.spec.selector.matchLabels = {"test": "$*"}' | \ - $(YQ) '.spec.template.metadata.labels = {"test": "$*"}' | \ + yq '.metadata.name = "$*"' | \ + yq '.spec.selector.matchLabels = {"test": "$*"}' | \ + yq '.spec.template.metadata.labels = {"test": "$*"}' | \ $(KUBECTL) apply -f - .PHONY: install-test-pod