This repository has been archived by the owner on Oct 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
launch.sh
95 lines (90 loc) · 3.5 KB
/
launch.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
#!/bin/bash
mkdir -p output
URL="starcatcher.us"
rm mod.txt
mod=$?
if [ $mod -ne 0 ]; then
rm /c/StarHTTP/TPT/Download/Output/{config,error,output}*
rm /c/StarHTTP/TPT/Download/Output/*.{zip,ptu}
else
rm /c/StarHTTP/TPT/mod/Output/{config,error,output}*
rm /c/StarHTTP/TPT/mod/Output/*.{zip,ptu}
fi
echo grep -o ' ' args.txt | wc -l
#if [ test `wc -w args.txt` -gt 2 ] || [ ! grep "MSVC" args.txt ]; then
if [ -f "lock.txt" ]; then
echo "msg ##jacob1 Error: vagrant is already running" | ./nc.exe -w 1 localhost 9876
exit 1
fi
touch lock.txt
rm output.txt
export VAGRANT_HOME="C:\Starcatcher\Vagrant\files"
vagrant up
if [ $mod -ne 0 ]; then
echo 1
vagrant ssh -c "pushd The-Powder-Toy/updatepackager && ./compile.sh $(cat args.txt) && ./packager.sh $(cat args.txt) && ./move.sh || (./move.sh && false)" >output.txt 2>&1
else
echo 1
vagrant ssh -c "pushd Jacob1sMod/updatepackager && ./compile.sh $(cat args.txt) && ./packager.sh $(cat args.txt) && ./move.sh || (./move.sh && false)" >output.txt 2>&1
fi
success=$?
vagrant halt
rm lock.txt
#else
# if [ $mod -ne 0 ]; then
# echo "msg #powder-dev Skipping vagrant" | ./nc.exe -w 1 localhost 9876
# else
# echo "msg ##jacob1 Skipping vagrant" | ./nc.exe -w 1 localhost 9876
# fi
# success=0
#fi
if [ $success -ne 0 ]; then
rm output/latest*.log
if [ $mod -ne 0 ]; then
mv output/*.log /c/StarHTTP/TPT/Download/Output
mv output.txt /c/StarHTTP/TPT/Download/Output/vagrantoutput.txt
echo "msg #powder-dev Build Script Failed, details at https://$URL/TPT/Download/Output" | ./nc.exe -w 1 localhost 9876
else
mv output/*.log /c/StarHTTP/TPT/mod/Output
mv output.txt /c/StarHTTP/TPT/mod/Output/vagrantoutput.txt
echo "msg ##jacob1 Build Script Failed, details at https://$URL/TPT/mod/Output" | ./nc.exe -w 1 localhost 9876
fi
else
if [ $mod -ne 0 ]; then
./compilemsvc.sh >>output.txt 2>&1
if [ $? -ne 0 ]; then
rm source/The-Powder-Toy/latest*.log
mv source/The-Powder-Toy/*.log /c/StarHTTP/TPT/Download/Output
mv output.txt /c/StarHTTP/TPT/Download/Output/vagrantoutput.txt
echo "msg #powder-dev MSVC compile Failed, details at https://$URL/TPT/Download/Output" | ./nc.exe -w 1 localhost 9876
exit 1
fi
source/updatepackager/package.sh >>output.txt 2>&1
if [ $? -ne 0 ]; then
rm source/The-Powder-Toy/latest*.log
mv source/The-Powder-Toy/*.log /c/StarHTTP/TPT/Download/Output
mv output.txt /c/StarHTTP/TPT/Download/Output/vagrantoutput.txt
echo "msg #powder-dev MSVC package Failed, details at https://$URL/TPT/Download/Output" | ./nc.exe -w 1 localhost 9876
exit 1
fi
echo "msg #powder-dev Compile Succeeded (pending - https://$URL/TPT/changelog.lua)" | ./nc.exe -w 1 localhost 9876
else
./compilemsvcmod.sh >>output.txt 2>&1
if [ $? -ne 0 ]; then
rm source/Jacob1sMod/latest*.log
mv source/Jacob1sMod/*.log /c/StarHTTP/TPT/mod/Output
mv output.txt /c/StarHTTP/TPT/mod/Output/vagrantoutput.txt
echo "msg ##jacob1 MSVC compile Failed, details at https://$URL/TPT/mod/Output" | ./nc.exe -w 1 localhost 9876
exit 1
fi
source/updatepackager/packagemod.sh $(cat args.txt) >>output.txt 2>&1
if [ $? -ne 0 ]; then
rm source/Jacob1sMod/latest*.log
mv source/Jacob1sMod/*.log /c/StarHTTP/TPT/mod/Output
mv output.txt /c/StarHTTP/TPT/mod/Output/vagrantoutput.txt
echo "msg ##jacob1 MSVC package Failed, details at https://$URL/TPT/mod/Output" | ./nc.exe -w 1 localhost 9876
exit 1
fi
echo "msg ##jacob1 Compile Succeeded (pending - https://$URL/TPT/modchangelog.lua)" | ./nc.exe -w 1 localhost 9876
fi
fi