-
Notifications
You must be signed in to change notification settings - Fork 4
/
start.sh
executable file
·44 lines (43 loc) · 1.92 KB
/
start.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
PATH_TO_SCRIPT=${BASH_SOURCE%/*}
if [ -z $1 ]
then
echo ""
echo "Starting server"
echo ""
echo "---------------------------------------------------------------------------------------------"
echo ""
cd "${PATH_TO_SCRIPT}/server" && ./gradlew run
elif [ $1 == '--install' ]
then
echo ""
echo "Will install npm dependencies, build and ship gui to server and then start server"
echo ""
echo "---------------------------------------------------------------------------------------------"
echo ""
cd "${PATH_TO_SCRIPT}/client" && npm install && npm run build && npm run deploy
elif [ $1 == '--prep-docker' ]
then
echo ""
echo "Will prepare files for docker image copper-monitoring"
echo ""
echo "---------------------------------------------------------------------------------------------"
echo ""
cd "${PATH_TO_SCRIPT}/client" && npm install && npm run build && npm run deploy && cd ../server && ./gradlew distZip && cp build/distributions/copper-monitoring.zip ../docker/
elif [ $1 == '--dockerize' ]
then
echo ""
echo "Will create docker image copper-monitoring from prepared files. ATTENTION: Run --prep-dock first to create the artifact!"
echo ""
echo "---------------------------------------------------------------------------------------------"
echo ""
cd "${PATH_TO_SCRIPT}/docker" && docker build -t copper-monitoring .
else
echo ""
echo "Script usage:"
echo "Run without arguments to start copper monitoring. Will not fetch laters client changes."
echo " P.S: use after you runned script with --install parameter."
echo "--install : will build client and copy it to server part as a preparation to run the copper-monitoring"
echo "--prep-docker : will build client & server parts and will prepare files for docker image of copper-monitoring"
echo "--dockerize : will create docker image of copper-monitoring"
fi