-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (58 loc) · 1.47 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
include Makefile.env
APP_VERSION := $(shell git describe --tags)
CI_COMMIT_SHA := $(shell git rev-parse HEAD)
# BE HELPERS
docker-login:
docker login \
-u ${CI_REGISTRY_USER} \
-p ${CI_JOB_TOKEN} \
https://${CI_REGISTRY}
docker-build:
docker build \
--target production \
--tag=${IMAGE_NAME}:${APP_VERSION} \
--tag=${IMAGE_NAME}:${CI_COMMIT_SHA} \
--build-arg APP_VERSION=${APP_VERSION} \
--build-arg ROLLBAR_ACCESS_TOKEN=${POST_SERVER_ITEM_ROLLBAR_ACCESS_TOKEN} \
backend
docker-push:
docker image push --all-tags ${IMAGE_NAME}
# BE JOBS
build-be-job: docker-login docker-build docker-push
stg-be-deploy-job:
kubectl set image \
deployment/${K8S_DEPLOYMENT} \
oetzit=${IMAGE_NAME}:${CI_COMMIT_SHA} \
--namespace=kommul-dev
prd-be-deploy-job:
kubectl set image \
deployment/${K8S_DEPLOYMENT} \
oetzit=${IMAGE_NAME}:${CI_COMMIT_SHA} \
--namespace=kommul
# FE HELPERS
get-butler:
wget -O butler.zip ${BUTLER_URL}
unzip butler.zip
chmod +x tmp/butler
./butler -V
# FE JOBS
stg-build-fe-node-job:
rm -rf frontend/dist/stg
cd frontend && \
NODE_ENV=staging \
npm run build -- --dist-dir dist/stg
prd-build-fe-node-job:
rm -rf frontend/dist/prd
cd frontend && \
NODE_ENV=production \
npm run build -- --dist-dir dist/prd
stg-fe-deploy-job:
./butler push \
frontend/dist/stg \
eurac/oetzit-staging:html5 \
--userversion ${APP_VERSION}
prd-fe-deploy-job:
./butler push \
frontend/dist/prd \
eurac/oetzit:html5 \
--userversion ${APP_VERSION}