-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy-prod.sh
executable file
·44 lines (35 loc) · 1.33 KB
/
deploy-prod.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
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Stop and remove all container
docker compose -f docker-compose.prod.yml --env-file ./.properties/env/.prod.env down
docker rmi re-mlac-origin-server
docker rmi re-mlac-virtual-firewall
docker rmi re-mlac-virtual-web-server
docker rmi re-mlac-virtual-web-application-server
rm -rf origin-server/src/main/resources
rm -rf virtual-firewall/src/main/resources
rm -rf virtual-web-server/src/main/resources
rm -rf virtual-web-application-server/src/main/resources
# Make the environment file
mkdir -p origin-server/src/main/resources
mkdir -p virtual-firewall/src/main/resources
mkdir -p virtual-web-server/src/main/resources
mkdir -p virtual-web-application-server/src/main/resources
cp -r .properties/origin/ origin-server/src/main/resources
cp -r .properties/virtual/* virtual-firewall/src/main/resources
cp -r .properties/virtual/* virtual-web-server/src/main/resources
cp -r .properties/virtual/* virtual-web-application-server/src/main/resources
# Build the project
cd origin-server
./gradlew clean build -x test
cd ..
cd virtual-firewall
./gradlew clean build -x test
cd ..
cd virtual-web-server
./gradlew clean build -x test
cd ..
cd virtual-web-application-server
./gradlew clean build -x test
cd ..
# Build the docker image and start the container
docker compose -f docker-compose.prod.yml --env-file ./.properties/env/.prod.env up -d