mattermore/deploy.sh

27 lines
587 B
Bash
Raw Normal View History

2019-02-13 20:17:42 +00:00
#!/bin/bash
2019-02-13 19:54:18 +00:00
set -eo pipefail
2019-02-13 20:29:54 +00:00
if (git status --porcelain=2 -uno | grep '' ); then
2019-02-13 19:54:18 +00:00
echo "You have unstaged changes."
echo "This shouldn't happen in production."
echo "Plsfix. Dank."
exit 1
fi
echo "Pulling from remote."
git pull
if [[ config.py.example -nt config.py ]]; then
echo "Example config file is newer than the current config file. Plsfix."
exit 1
fi
2019-02-13 19:54:18 +00:00
echo "Updating dependencies."
2019-02-13 20:46:51 +00:00
~/env/bin/pip install -r requirements.txt
2019-02-13 19:54:18 +00:00
echo "Migrating database."
~/env/bin/flask db upgrade
echo "Restarting server using passenger."
passenger-config restart-app .