-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmpgp-cli.sh
More file actions
executable file
·37 lines (28 loc) · 1.04 KB
/
mpgp-cli.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.04 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
#!/usr/bin/env bash
PROJECT=${1:-client}
API_SERVER_PROJECT_DIR="/home/agent4mpgp/mpgp/src/Mpgp.RestApiServer"
BROWSER_CLIENT_OUTPUT_DIR="/home/agent4mpgp/mpgp/src/Mpgp.RestApiServer/wwwroot"
BROWSER_CLIENT_PROJECT_DIR="/home/agent4mpgp/BrowserClient"
function rebuildRestApiServer {
sudo systemctl stop mpgp-api.service
cd $API_SERVER_PROJECT_DIR
git pull gitlab build
ln -sf $(pwd)/appsettings.json $(pwd)/bin/Release/netcoreapp2.0/appsettings.json
ln -sf $(pwd)/wwwroot $(pwd)/bin/Release/netcoreapp2.0/wwwroot
sudo systemctl start mpgprestapiserver.service
}
function rebuildBrowserClient {
cd $BROWSER_CLIENT_PROJECT_DIR
git pull gitlab build
rm -rf $BROWSER_CLIENT_OUTPUT_DIR"/static"
cp -rf $BROWSER_CLIENT_PROJECT_DIR"/build/*" $BROWSER_CLIENT_OUTPUT_DIR"/"
}
if [ $PROJECT == "api" ] || [ $PROJECT == "a" ] || [ $PROJECT == "rest" ] || [ $PROJECT == "r" ]
then
rebuildRestApiServer
elif [ $PROJECT == "client" ] || [ $PROJECT == "c" ]
then
rebuildBrowserClient
else
echo "Argument Exception"
fi