Improve build script
This commit is contained in:
parent
f84dee72c0
commit
bf6f1b3339
30
build.sh
30
build.sh
@ -1,13 +1,31 @@
|
|||||||
|
supervisor_name=schafkopf
|
||||||
|
|
||||||
echo "[1/7] Stopping server..."
|
echo "[1/7] Stopping server..."
|
||||||
sudo supervisorctl stop schafkopf
|
sudo supervisorctl stop supervisor_name
|
||||||
|
|
||||||
echo "[2/7] Changing permissions..."
|
echo "[2/7] Changing permissions..."
|
||||||
sudo chown -R pi:pi .
|
if ! sudo chown -R pi:pi .; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[3/7] Pulling changes..."
|
echo "[3/7] Pulling changes..."
|
||||||
git pull
|
if ! git pull; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[4/7] Building project..."
|
echo "[4/7] Building project..."
|
||||||
swift build -c release
|
if ! swift build -c release; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[5/7] Restoring permissions..."
|
echo "[5/7] Restoring permissions..."
|
||||||
sudo chown -R www-data:www-data .
|
if ! sudo chown -R www-data:www-data .; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[6/7] Starting server..."
|
echo "[6/7] Starting server..."
|
||||||
sudo supervisorctl start schafkopf
|
if ! sudo supervisorctl start $supervisor_name; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[7/7] Done"
|
echo "[7/7] Done"
|
||||||
|
Loading…
Reference in New Issue
Block a user