-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 846 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
31
32
33
34
35
36
37
38
39
40
.PHONY: build create delete push deploy
IMAGE=kaspernissen/hello-go
TAG=latest
ARCH=arm
OS=linux
IP=192.168.1.100
PORT=$(shell kubectl get svc hello -o json | jq '.spec.ports[].nodePort')
build:
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build hello.go
docker build -t $(IMAGE):$(TAG) .
@rm -f hello
push:
docker push $(IMAGE):$(TAG)
local:
@rm -f hello
CGO_ENABLED=0 GOOS=darwin go build hello.go
./hello
delete:
kubectl delete -f kubernetes/deployment.yaml
kubectl delete -f kubernetes/svc.yaml
deploy:
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/svc.yaml
kubectl rollout status deploy/hello
ping:
while sleep 0.5; do curl http://$(IP):$(PORT)/ping; done
version:
while sleep 0.5; do curl http://$(IP):$(PORT)/version; done
hostname:
while sleep 0.5; do curl http://$(IP):$(PORT)/host; done