-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·59 lines (46 loc) · 1.4 KB
/
deploy.sh
File metadata and controls
executable file
·59 lines (46 loc) · 1.4 KB
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
#!/bin/bash
clear
echo "------------------------------------------------------------------"
echo "Start deploying socobo..."
echo "------------------------------------------------------------------"
echo
echo
echo "------------------------------------------------------------------"
echo "1. step: clean dist directories"
echo "------------------------------------------------------------------"
echo
if test -d client/dist
then
rm -r client/dist
fi
if test -d server/dist
then
rm -r server/dist
fi
echo
echo "------------------------------------------------------------------"
echo "2. step: build frontend project"
echo "------------------------------------------------------------------"
echo
if [ "$1" = "-p" ]
then
cd client && npm run ng build -prod && cd ..
else
cd client && npm run ng build && cd ..
fi
echo
echo "------------------------------------------------------------------"
echo "3. step: copy frontend project into public server dist folder"
echo "------------------------------------------------------------------"
echo
if ! test -d server/dist/public
then
mkdir server/dist && mkdir server/dist/public
fi
cp -rv client/dist/* server/dist/public
echo
echo "------------------------------------------------------------------"
echo "4. step: build server project and open browser"
echo "------------------------------------------------------------------"
echo
cd server && npm run start:p