-
Notifications
You must be signed in to change notification settings - Fork 41
/
makefile
44 lines (33 loc) · 1.53 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
38
39
40
41
42
43
44
# update based on your IBM Container Registry namespace
NAMESPACE=<YOUR_CONTAINER_REGISTRY>
# update based on your Ingress Subdomain (use `ibmcloud ks cluster get --cluster <CLUSTERNAME>` to obtain)
INGRESSSUBDOMAIN=jpetstore.<YOUR_INGRESS_SUBDOMAIN>
# the IBM container registry
REGISTRY=us.icr.io
TIMESTAMP="$(shell date)"
build-petstore:
cd jpetstore && docker build . -t $(REGISTRY)/$(NAMESPACE)/jpetstoreweb
docker push $(REGISTRY)/$(NAMESPACE)/jpetstoreweb
cd jpetstore/db && docker build . -t $(REGISTRY)/$(NAMESPACE)/jpetstoredb
docker push $(REGISTRY)/$(NAMESPACE)/jpetstoredb
build-mmssearch:
cd mmssearch && docker build . -t $(REGISTRY)/$(NAMESPACE)/mmssearch
docker push $(REGISTRY)/$(NAMESPACE)/mmssearch
create-secrets:
cd mmssearch && kubectl create secret generic mms-secret --from-file=mms-secrets=./mms-secrets.json
deploy-using-helm:
cd helm && helm install --name jpetstore ./modernpets
cd helm && helm install --name mmssearch ./mmssearch
remove-deployments:
helm delete jpetstore --purge
helm delete mmssearch --purge
remove-images:
ibmcloud cr image-rm $(REGISTRY)/$(NAMESPACE)/jpetstoredb
ibmcloud cr image-rm $(REGISTRY)/$(NAMESPACE)/jpetstoreweb
ibmcloud cr image-rm $(REGISTRY)/$(NAMESPACE)/mmssearch
remove-secrets:
kubectl delete secret mms-secret
rolling-update:
cd mmssearch && docker build . -t $(REGISTRY)/$(NAMESPACE)/mmssearch
docker push $(REGISTRY)/$(NAMESPACE)/mmssearch
kubectl patch deployment mmssearch-mmssearch -p '{"spec":{"template":{"metadata":{"annotations":{"date":$(TIMESTAMP)}}}}}'