Commit 53d72ce2b0fb4a7d4a2cb7893b6f6f800845e389

Authored by Andrew Buss
1 parent 377aea549e
Exists in master

Moved deployment stuff to setup_production.sh

Showing 1 changed file with 14 additions and 1 deletions Side-by-side Diff

scripts/setup_production.sh View file @ 53d72ce
1 1 #!/bin/bash -xe
2 2 source venv/bin/activate
  3 +source secrets
3 4 pip install psycopg2
4 5 python manage.py migrate
  6 +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/