Add a basic script to "push" deploy
Currently updates are published by the "conservancy-www-update.sh" that does a "pull" deploy with a 5-minutely job that runs on the web server. This doesn't run `migrate`, `collectstatic` or restart the application, so certain types of changes don't take effect, and even template changes often don't due to caching template loader. This script allows you to deploy more significant updates on-demand, but requires SSH access.
This commit is contained in:
parent
49e3c43299
commit
55ee5b53b6
13 changed files with 13 additions and 0 deletions
13
deploy.sh
Executable file
13
deploy.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ssh debian@hickory.sfconservancy.org 'bash -s' << EOF
|
||||||
|
set -x # Show output
|
||||||
|
set -e # Abort on failure
|
||||||
|
cd /var/www/website
|
||||||
|
sudo -u www-data git pull
|
||||||
|
sudo -u www-data /var/www/venv-website/bin/python manage.py check
|
||||||
|
sudo -u www-data /var/www/venv-website/bin/python manage.py migrate
|
||||||
|
sudo -u www-data /var/www/venv-website/bin/python manage.py collectstatic -v0 --noinput --link
|
||||||
|
sudo systemctl restart apache2
|
||||||
|
curl --silent --head https://sfconservancy.org | grep --perl-regexp "^HTTP/.+ 200"
|
||||||
|
EOF
|
Loading…
Reference in a new issue