-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (25 loc) · 950 Bytes
/
Makefile
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
.DEFAULT_GOAL := init
KUBE_CONTEXT := k3d-k3s-default
.PHONY: apply-dev
apply-dev:
kustomize build ./vault/dev --enable-helm | kubectl apply --context=$(KUBE_CONTEXT) -f -
kustomize build ./external-secrets/dev --enable-helm | kubectl apply --context=$(KUBE_CONTEXT) -f -
kustomize build ./argo-cd/dev --enable-helm | kubectl apply --context=$(KUBE_CONTEXT) -f -
TOOLS := pre-commit:brew
init: install-tools pre-commit-install
install-tools:
@echo "Installing tools..."
@$(foreach tool,$(TOOLS),$(call install_if_missing,$(word 1,$(subst :, ,$(tool))),$(word 2,$(subst :, ,$(tool))));)
pre-commit-install:
@echo "Installing pre-commit..."
@pre-commit install
@pre-commit install --hook-type commit-msg
install_if_missing = \
if ! command -v $(1) &> /dev/null; then \
echo "Installing $(1) with $(2)..."; \
if [ "$(2)" = "brew" ]; then \
brew install $(1); \
elif [ "$(2)" = "pip" ]; then \
pip install $(1); \
fi; \
fi