2020-05-17 18:48:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-05-19 12:49:31 +00:00
|
|
|
set -e
|
|
|
|
|
2020-06-19 11:44:39 +00:00
|
|
|
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-05-17 18:48:47 +00:00
|
|
|
|
2020-06-19 11:56:39 +00:00
|
|
|
echo -n "... bumping "
|
2020-06-19 11:29:51 +00:00
|
|
|
version=$(date +"%y%m%d")
|
2021-07-12 09:13:57 +00:00
|
|
|
sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html
|
2020-06-19 11:29:51 +00:00
|
|
|
|
2021-07-05 20:42:51 +00:00
|
|
|
echo -n "... collecting "
|
2021-07-12 09:13:57 +00:00
|
|
|
python3 manage.py collectstatic --settings coinmanager.production_settings --no-input
|
2021-07-05 20:42:51 +00:00
|
|
|
|
2020-06-19 11:56:39 +00:00
|
|
|
echo -n "... owning "
|
2020-06-23 11:12:31 +00:00
|
|
|
sudo chmod 775 db.sqlite3
|
2021-07-12 09:13:57 +00:00
|
|
|
sudo chown -R $user:$web_user $path
|
2020-05-31 21:39:17 +00:00
|
|
|
|
2020-06-19 11:56:39 +00:00
|
|
|
echo "... reloading "
|
2021-07-12 09:13:57 +00:00
|
|
|
sudo systemctl restart apache2
|