-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·55 lines (49 loc) · 934 Bytes
/
build.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
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# backend:
echo "1) start build backend image"
cd backend
echo "1.1) start build user image"
cd user
go build -o ./build/main ./main
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
echo "1.1) finish build user image"
echo "1.2) start build drive image"
cd drive
go build -o ./build/main ./main
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
echo "1.2) finish build drive image"
echo "1.3) start build storage image"
cd storage
go build -o ./build/main ./main
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
echo "1.3) finish build storage image"
cd ..
echo "1) finish build backend image"
# fronted:
echo "2) start build frontend image"
cd frontend
npm run build
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
echo "2) finish build frontend image"
echo "3) start deploy"
docker compose down
docker compose build
if [ $? -ne 0 ]; then
exit 1
fi
docker image prune --force
docker volume prune --force
docker compose up -d
echo "3) finish deploy"