Commit 26abd7967db140ec0e2d2251880e3bf06d483fc6

Authored by Andrew Buss
1 parent 8822360d74
Exists in master

Moved part of deploy back to jenkins

Showing 2 changed files with 2 additions and 13 deletions Inline Diff

scripts/run_production.sh View file @ 26abd79
#!/bin/bash -xe 1 1 #!/bin/bash -xe
source secrets 2 2 source secrets
source venv/bin/activate 3 3 source venv/bin/activate
gunicorn -b flashy.cards:7002 flashy.wsgi 4 4 venv/bin/gunicorn -b flashy.cards:7002 flashy.wsgi
5 5
scripts/setup_production.sh View file @ 26abd79
#!/bin/bash -xe 1 1 #!/bin/bash -xe
whoami 2 2 whoami
source venv/bin/activate 3 3 source venv/bin/activate
source secrets 4 4 source secrets
#pip install psycopg2 5 5 #pip install psycopg2
python manage.py migrate 6 6 python manage.py migrate
echo "Checking whether nginx conf was updated" 7
DIFF=$(diff /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available/flashy.cards) 8
if [ "$DIFF" != "" ] 9
then 10
echo "Restarting nginx" 11
cp -v /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available 12
sudo /etc/init.d/nginx reload 13
fi 14
echo "Syncing static files" 15
rsync -rP /srv/flashy-backend/static/ /srv/static 16
echo "Poking uwsgi to restart the site" 17
cp -v /srv/flashy-backend/flashy.ini /etc/uwsgi/ 18