-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.local
48 lines (39 loc) · 1.29 KB
/
Makefile.local
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
48
MAKEFLAGS += --silent
SHELL = /bin/bash
.DEFAULT_GOAL := all
CHART_NAME := dotnet-api
IMAGE := demo
VERSION := 0.0.1
NS := demo
DNS_NAME := demo.chart
CHART_VERSION := $(shell cat charts/$(CHART_NAME)/Chart.yaml | grep -m 1 ^version:| awk '{print $$2}' | xargs)
.PHONY: all minikube build install clean
all: minikube build deploy clean
deploy:
bash -x ./scripts/deploy.sh $(CHART_NAME) $(IMAGE) $(VERSION) \
--version="$(CHART_VERSION)" \
--set image.pullPolicy=Never \
--create-namespace --namespace "${NS}" \
--set ingress.enabled=true \
--set ingress.annotations".nginx\.ingress\.kubernetes\.io/rewrite-target"=/\$1 \
--set "ingress.hosts[0].host=${DNS_NAME},ingress.hosts[0].paths[0].path=/,ingress.hosts[0].paths[0].pathType=ImplementationSpecific" \
--debug
build:
./scripts/build-local.sh $(IMAGE) $(VERSION)
minikube:
minikube delete || true
minikube start --addons=ingress
kubectl config use-context minikube
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=90s
clean:
helm uninstall -n $(NS) $(CHART_NAME)
echo
echo
echo "You are about to delete demo cluster."
echo "Are you sure? (Press Enter to continue or Ctrl+C to abort) "
read _
minikube delete
-include include.mk