32 lines
679 B
Bash
Executable File
32 lines
679 B
Bash
Executable File
#!/bin/bash
|
|
|
|
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 "
|
|
git pull -q origin master >/dev/null
|
|
|
|
echo -n "... bumping "
|
|
version=$(date +"%y%m%d")
|
|
sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html >/dev/null
|
|
|
|
echo -n "... collecting "
|
|
python3 manage.py collectstatic --settings coinmanager.production_settings --no-input >/dev/null
|
|
|
|
echo -n "... owning "
|
|
sudo chmod 775 db.sqlite3
|
|
sudo chown -R $user:$web_user $path >/dev/null
|
|
|
|
echo "... reloading "
|
|
sudo systemctl restart apache2 >/dev/null
|