formatting, parameterising, add user safety check
This commit is contained in:
parent
a077e1346f
commit
e2f285b730
31
update
31
update
@ -2,19 +2,34 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "cloning ..."
|
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
|
git pull -q origin master >/dev/null
|
||||||
|
echo "..."
|
||||||
|
|
||||||
echo "collecting ..."
|
echo -n "collecting "
|
||||||
cd /home/willipink/coinmanager/coinmanager
|
|
||||||
pipenv run python manage.py collectstatic --settings coinmanager.production_settings --no-input >/dev/null
|
pipenv run python manage.py collectstatic --settings coinmanager.production_settings --no-input >/dev/null
|
||||||
|
echo "..."
|
||||||
|
|
||||||
echo "bumping ..."
|
echo -n "bumping "
|
||||||
version=$(date +"%y%m%d")
|
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 >/dev/null
|
||||||
|
echo "..."
|
||||||
|
|
||||||
echo "owning ..."
|
echo -n "owning "
|
||||||
sudo chown -R willipink:www-data /home/willipink/coinmanager >/dev/null
|
sudo chown -R $user:$web_user $path >/dev/null
|
||||||
|
echo "..."
|
||||||
|
|
||||||
echo "reloading ..."
|
echo -n "reloading "
|
||||||
sudo systemctl reload apache2 >/dev/null
|
sudo systemctl reload apache2 >/dev/null
|
||||||
|
echo "..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user