-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile.tools
More file actions
47 lines (40 loc) · 1.46 KB
/
Makefile.tools
File metadata and controls
47 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
## Makefile.tools
## This file contains all tool installation targets and version definitions.
## It is included by the main Makefile and serves as the single source of truth for tool versions.
##
## Usage:
## make helm - Install helm
## make mdox - Install mdox
## make helm-unittest - Install helm-unittest plugin
## make clean-tools - Remove all installed tools
## Tool versions
HELM_VERSION ?= v3.17.1
HELM_UNITTEST_VERSION ?= v1.0.3
## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool binaries
HELM ?= $(LOCALBIN)/helm
MDOX ?= $(LOCALBIN)/mdox
.PHONY: helm
$(HELM) helm: $(LOCALBIN) ## Install helm locally if necessary.
@{ \
set -ex ;\
[[ -f $(HELM) ]] && exit 0 ;\
OS=$$(go env GOOS) && ARCH=$$(go env GOARCH) && \
curl -sSL https://get.helm.sh/helm-$(HELM_VERSION)-$${OS}-$${ARCH}.tar.gz | tar xz -C $(LOCALBIN) --strip-components=1 $${OS}-$${ARCH}/helm ;\
}
.PHONY: mdox
$(MDOX) mdox: $(LOCALBIN) ## Install mdox locally if necessary.
@{ \
set -ex ;\
[[ -f $(MDOX) ]] && exit 0 ;\
GOBIN=$(LOCALBIN) go install github.com/bwplotka/mdox@latest ;\
}
.PHONY: helm-unittest
helm-unittest: helm ## Install helm-unittest plugin if necessary.
@$(HELM) plugin list | grep -q unittest || $(HELM) plugin install https://github.com/helm-unittest/helm-unittest --version $(HELM_UNITTEST_VERSION)
.PHONY: clean-tools
clean-tools: ## Remove all installed tools.
rm -rf $(LOCALBIN)