forked from eclipse-emfcloud/coffee-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·117 lines (101 loc) · 3.71 KB
/
run.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
echo "$(date +"[%T.%3N]") Evaluate Options... "
buildBackend='false'
copyBackend='false'
downloadServers='false'
buildFrontend='false'
forceFrontend='false'
runFrontend='false'
if [[ "$1" == "" ]]; then
buildBackend='true'
copyBackend='true'
downloadServers='true'
buildFrontend='true'
runFrontend='true'
fi
if [[ ${#1} -gt 2 ]]; then
if [[ "$1" == -*"b"* ]]; then
buildBackend='true'
fi
if [[ "$1" == -*"c"* ]]; then
copyBackend='true'
fi
if [[ "$1" == -*"d"* ]]; then
downloadServers='true'
fi
if [[ "$1" == -*"f"* ]]; then
buildFrontend='true'
fi
if [[ "$1" == -*"r"* ]]; then
runFrontend='true'
fi
if [[ "$1" == -*"ff"* ]]; then
forceFrontend='true'
fi
fi
while [ "$1" != "" ]; do
case $1 in
-b | --backend ) buildBackend='true'
;;
-c | --copy ) copyBackend='true'
;;
-d | --download ) downloadServers='true'
;;
-f | --frontend ) buildFrontend='true'
;;
-ff | --forcefrontend ) forceFrontend='true'
;;
-r | --run ) runFrontend='true'
;;
esac
shift
done
[[ "$buildBackend" == "true" ]] && echo " Build Backend (-b)" || echo " Do not build Backend (-b)"
[[ "$copyBackend" == "true" ]] && echo " Copy Backend (-c)" || echo " Do not copy Backend (-c)"
[[ "$downloadServers" == "true" ]] && echo " Download Model & GLSP Servers (-d)" || echo " Do not download Model & GLSP Servers (-d)"
[[ "$forceFrontend" == "true" ]] && echo " Remove yarn.lock (-ff)" || echo " Do not remove yarn.lock (-ff)"
[[ "$buildFrontend" == "true" ]] && echo " Build Frontend (-f)" || echo " Do not build Frontend (-f)"
[[ "$runFrontend" == "true" ]] && echo " Run Frontend (-r)" || echo " Do not run Frontend (-r)"
if [ "$buildBackend" == "true" ]; then
echo "$(date +"[%T.%3N]") Build backend products"
cd backend/releng/com.eclipsesource.coffee.parent/
mvn clean install
cd ../../../
fi
if [ "$copyBackend" == "true" ]; then
echo "$(date +"[%T.%3N]") Copy built products..."
inputCodeGen=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.codegen/linux/gtk/x86_64
outputCodeGen=web/coffee-java-extension/server
echo " $(date +"[%T.%3N]") Copy CodeGen to '$outputCodeGen'."
rm -rf $outputCodeGen && mkdir -p $outputCodeGen && cp -rf $inputCodeGen $outputCodeGen
inputWorkflowAnalyzer=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.workflow.analyzer/linux/gtk/x86_64
outputWorkflowAnalyzer=web/coffee-workflow-analyzer/server
echo " $(date +"[%T.%3N]") Copy WorkflowAnalyzer to '$outputWorkflowAnalyzer'."
rm -rf $outputWorkflowAnalyzer && mkdir -p $outputWorkflowAnalyzer && cp -rf $inputWorkflowAnalyzer $outputWorkflowAnalyzer
inputWorkflowDSL=backend/releng/com.eclipsesource.coffee.product/target/products/com.eclipsesource.coffee.product.workflow.dsl/linux/gtk/x86_64
outputWorkflowDSL=web/coffee-workflow-analyzer-editors/server
echo " $(date +"[%T.%3N]") Copy WorkflowDSL to '$outputWorkflowDSL'."
rm -rf $outputWorkflowDSL && mkdir -p $outputWorkflowDSL && cp -rf $inputWorkflowDSL $outputWorkflowDSL
echo "$(date +"[%T.%3N]") Copy finished."
fi
if [ "$downloadServers" == "true" ]; then
cd ./web/coffee-server/scripts/
./download-server.sh
cd ../../../
fi
if [ "$forceFrontend" == "true" ]; then
cd web/
rm -f ./yarn.lock
cd ..
fi
if [ "$buildFrontend" == "true" ]; then
cd web/
yarn
cd ..
fi
if [ "$runFrontend" == "true" ]; then
workspace=$(pwd)
(sleep 5 && firefox 127.1:3000/#/${workspace:1}/backend/examples/SuperBrewer3000)&
cd web/browser-app
yarn start --hostname 0.0.0.0
fi