-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 1.09 KB
/
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
VERSION=0.1.6
IMAGE_NAME=gilly
IMAGE_REGISTRY=docker.io
build: ssl build-image template
install: ssl template deploy
uninstall: deploy-cleanup
deploy:
kubectl apply -f deploy/stack.yaml
deploy-cleanup:
kubectl delete -f deploy/stack.yaml
build-image:
docker build -t sgryczan/$(IMAGE_NAME):$(VERSION) .
sed "s/KUBE_CA_BUNDLE/$(make -s kube-get-ca-bundle)/" deploy/template.yaml > deploy/stack.yaml
ssl:
make -C ssl cert
template:
sed "s/KUBE_CA_BUNDLE/$(shell make -s kube-get-ca-bundle)/; s/IMAGE_VERSION/$(VERSION)/; s/IMAGE_REGISTRY/$(IMAGE_REGISTRY)/; s/IMAGE_NAME/$(IMAGE_NAME)/" deploy/template.yaml > deploy/stack.yaml
kubectl create secret generic gilly-certs \
--from-file=./ssl/gilly.pem --from-file ./ssl/gilly.key -n gilly --dry-run -o yaml >> deploy/stack.yaml
push:
docker push sgryczan/$(IMAGE_NAME):$(VERSION)
build-bin:
go build -o gilly gilly.go
kube-get-ca-bundle:
kubectl config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}'
.PHONY: build build-image build-image-bigtop ssl push build-bin kube-get-ca-bundle template deploy