-
Notifications
You must be signed in to change notification settings - Fork 6
/
09-deploy-frontend-and-backend.sh
executable file
·32 lines (23 loc) · 1.25 KB
/
09-deploy-frontend-and-backend.sh
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
#!/bin/bash
# Environment
. ./00-environment.sh
CURRENT_DIR=$(pwd)
oc project ${PROJECT_NAME}
# Deploy backend
cd ${CURRENT_DIR}/backend/
mvn fabric8:deploy -Popenshift -DskipTests
# Labels
oc label dc/backend app.openshift.io/runtime=java --overwrite -n ${PROJECT_NAME} && \
oc label dc/backend app.kubernetes.io/part-of=${APP_NAME} -n ${PROJECT_NAME} --overwrite
oc annotate dc/backend app.openshift.io/connects-to=backend-database --overwrite -n ${PROJECT_NAME} && \
oc annotate dc/backend app.openshift.io/vcs-uri=https://github.com/cvicens/state-machine-assistant.git --overwrite -n ${PROJECT_NAME} && \
oc annotate dc/backend app.openshift.io/vcs-ref=master --overwrite -n ${PROJECT_NAME}
# Deploy frontend
cd ${CURRENT_DIR}/frontend/
npm run openshift
# Labels
oc label dc/frontend app.openshift.io/runtime=nodejs --overwrite -n ${PROJECT_NAME} && \
oc label dc/frontend app.kubernetes.io/part-of=${APP_NAME} -n ${PROJECT_NAME} --overwrite
oc annotate dc/frontend app.openshift.io/connects-to=backend --overwrite -n ${PROJECT_NAME} && \
oc annotate dc/frontend app.openshift.io/vcs-uri=https://github.com/cvicens/state-machine-assistant.git --overwrite -n ${PROJECT_NAME} && \
oc annotate dc/frontend app.openshift.io/vcs-ref=master --overwrite -n ${PROJECT_NAME}