-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
38 lines (30 loc) · 1.26 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
PROJECT := $(shell gcloud config get-value project)
UI_IMAGE_REF = $(shell git rev-parse HEAD)
CORE_IMAGE_REF = $(shell git rev-parse HEAD)
all: build-core build-ui push-core push-ui update-deployment
echo "all done."
build-core:
echo "building core..."
cd blockchain-js-core && yarn build
build-ui:
echo "building UI..."
cd blockchain-js-ui && yarn build
run-ui:
echo "Running UI..."
cd blockchain-js-ui && ./node_modules/.bin/ng serve
push-core: build-core
echo "pushing blockchain-core (${CORE_IMAGE_REF})..."
cd blockchain-js-core && docker build . -t eu.gcr.io/${PROJECT}/blockchain-js-core:${CORE_IMAGE_REF}
gcloud docker -- push eu.gcr.io/${PROJECT}/blockchain-js-core:${CORE_IMAGE_REF}
push-ui:
echo "pushing UI (${UI_IMAGE_REF})..."
cd blockchain-js-ui && docker build . -t eu.gcr.io/${PROJECT}/blockchain-js-ui:${UI_IMAGE_REF}
gcloud docker -- push eu.gcr.io/${PROJECT}/blockchain-js-ui:${UI_IMAGE_REF}
update-deployment:
echo "ui : ${UI_IMAGE_REF}"
echo "core : ${CORE_IMAGE_REF}"
cat application.yaml | \
sed "s|/blockchain-js/blockchain-js-ui:latest|/${PROJECT}/blockchain-js-ui:${UI_IMAGE_REF}|g" | \
sed "s|/blockchain-js/blockchain-js-core:latest|/${PROJECT}/blockchain-js-core:${CORE_IMAGE_REF}|g" | \
kubectl apply -f -
watch kubectl get pods