-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (25 loc) · 883 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
GIT_COMMIT := $(shell git rev-parse --short HEAD)
IMAGE=harbor.liebi.com/slp/bifrost-collator-subql:$(GIT_COMMIT)
DEPLOY=bifrost-collator-subql
NAMESPACE=slp
K8S_DEPLOYMENT := deploy/*
create-ns:
@kubectl create ns ${NAMESPACE} || true
create-pull-secret:create-ns
kubectl create secret generic harbor \
--from-file=.dockerconfigjson=/root/.docker/config.json \
--type=kubernetes.io/dockerconfigjson -n ${NAMESPACE}
create-cm:
kubectl delete cm -n ${NAMESPACE} ${DEPLOY}-project-yaml
kubectl create cm -n ${NAMESPACE} ${DEPLOY}-project-yaml --from-file=project.yaml
update-yaml:
sed -i 's,image: .*,image: $(IMAGE),' $(K8S_DEPLOYMENT)
build:
docker build -f Dockerfile -t ${IMAGE} .
push:build
docker push ${IMAGE}
.PHONY: deploy
deploy:
kubectl apply -f deploy/deploy.yaml
update:push
kubectl set image deploy -n ${NAMESPACE} ${DEPLOY} ${DEPLOY}=${IMAGE}