/
run-projects.sh
66 lines (38 loc) · 1.6 KB
/
run-projects.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
#!/bin/bash
. scripts/utils/colors.sh
. scripts/utils/simbols.sh
. scripts/utils/messages.sh
msg_task "Running java -jar samples"
cd samples
delay=40
if [ -z "$1" ]; then #when there isnt parameters (without archetype input)
#IMPORTANT
#this if (no else) script only run projects on windows thought git bash
for d in * ; do
if [[ $d != *"node"* ]]; then #dont run project node y spring micros
cd $d
printf "%s$GREEN%s-------------------------------------------------------------------------------\n"
printf "%s$GREEN%s \u2713 ";
printf "%s$GREEN%s %s %s %s %s %s %s %s %s %s\n" "Launching service $d-0.0.1-SNAPSHOT.jar"
start "" "%SYSTEMDRIVE%\Program Files\Git\bin\sh.exe" --login -i -l -c "sh -c 'java -jar $PWD/target/$d-0.0.1-SNAPSHOT.jar'"
sleep $delay
printf "%s$GREEN%s \u2713 READY\n";
printf "%s$GREEN%s-------------------------------------------------------------------------------\n"
cd ..
fi
if [[ $d == *"node"* ]]; then #dont run project node and spring micros
cd $d
printf "%s$GREEN%s-------------------------------------------------------------------------------\n"
printf "%s$GREEN%s \u2713 ";
printf "%s$GREEN%s %s %s %s %s %s %s %s %s %s\n" "Launching node microservice"
start "" "%SYSTEMDRIVE%\Program Files\Git\bin\sh.exe" --login -i -l -c "sh -c 'node $PWD/src/index'"
sleep $delay
printf "%s$GREEN%s \u2713 READY\n";
printf "%s$GREEN%s-------------------------------------------------------------------------------\n"
cd ..
fi
delay=$(( $delay-5 ))
done
else
nohup java -jar $1/target/$1-0.0.1-SNAPSHOT.jar &
fi