migrate webapp to /opt

This commit is contained in:
willi pink 2022-07-08 13:12:28 +02:00
parent 50b8d19093
commit e6db06bb9a

16
update
View File

@ -3,13 +3,7 @@
set -e set -e
web_user="www-data" web_user="www-data"
user="willipink" path="/opt/coinmanager"
path="/home/willipink/coinmanager"
if [[ "$USER" != "$user" ]]; then
echo "You must be '$user' to run this file."
exit 1
fi
cd $path/coinmanager cd $path/coinmanager
@ -21,11 +15,11 @@ version=$(date +"%y%m%d")
sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html sed -i "s/[0-9]\{6\}/$version/g" coinc/templates/footer.html
echo -n "... collecting " echo -n "... collecting "
python3 manage.py collectstatic --settings coinmanager.production_settings --no-input pipenv run python3 manage.py collectstatic --settings coinmanager.production_settings --no-input
echo -n "... owning " echo -n "... owning "
sudo chmod 775 db.sqlite3 chmod 775 db.sqlite3
sudo chown -R $user:$web_user $path chown -R $web_user:$web_user $path
echo "... reloading " echo "... reloading "
sudo systemctl restart apache2 systemctl reload apache2