coinmanager/update

32 lines
679 B
Plaintext
Raw Normal View History

#!/bin/bash
2020-05-19 12:49:31 +00:00
set -e
web_user="www-data"
user="willipink"
path="/home/willipink/coinmanager"
if [[ "$USER" != "$user" ]]; then
echo "You must be '$user' to run this file."
exit 1
fi
cd $path/coinmanager
echo -n "fetching "
2020-06-17 06:10:46 +02:00
git pull -q origin master >/dev/null
2020-06-19 11:56:39 +00:00
echo -n "... bumping "
2020-06-19 11:29:51 +00:00
version=$(date +"%y%m%d")
sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html >/dev/null
2020-06-19 11:29:51 +00:00
2021-07-05 20:42:51 +00:00
echo -n "... collecting "
python3 manage.py collectstatic --settings coinmanager.production_settings --no-input >/dev/null
2020-06-19 11:56:39 +00:00
echo -n "... owning "
sudo chmod 775 db.sqlite3
sudo chown -R $user:$web_user $path >/dev/null
2020-05-31 21:39:17 +00:00
2020-06-19 11:56:39 +00:00
echo "... reloading "
2021-07-05 20:42:51 +00:00
sudo systemctl restart apache2 >/dev/null