66 lines
1.1 KiB
Bash
Executable File
66 lines
1.1 KiB
Bash
Executable File
#!/bin/zsh
|
|
|
|
NUM_RQWORKERS=4;
|
|
|
|
cd /home/misc-user/rzhdweb
|
|
|
|
echo "Pulling"
|
|
if git pull; then
|
|
echo "OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
exit 1
|
|
fi
|
|
|
|
echo "Migrating"
|
|
if DEBUG=TRUE ./manage.py migrate; then
|
|
echo "OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
exit 1
|
|
fi
|
|
|
|
echo "Restarting a-rzhdweb"
|
|
if sudo /bin/systemctl restart a-rzhdweb; then
|
|
echo "OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
exit 1
|
|
fi
|
|
|
|
echo "Waiting"
|
|
sleep 3
|
|
|
|
echo "Checking a-rzhdweb"
|
|
if sudo /bin/systemctl is-active a-rzhdweb; then
|
|
echo "OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
sudo /bin/systemctl status a-rzhdweb
|
|
exit 1
|
|
fi
|
|
|
|
echo "Restarting rqworkers"
|
|
for i in {1.."$NUM_RQWORKERS"}; do
|
|
if sudo /bin/systemctl restart a-rzhdweb-rqworker@"$i"; then
|
|
echo "$i"" - OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo "Waiting"
|
|
sleep 3
|
|
|
|
echo "Checking a worker"
|
|
if sudo /bin/systemctl is-active a-rzhdweb-rqworker@"$NUM_RQWORKERS"; then
|
|
echo "OK"
|
|
else
|
|
echo "=====ERROR====="
|
|
sudo /bin/systemctl status a-rzhdweb-rqworker@"$NUM_RQWORKERS"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Deploy successful"
|