Commit 8822360d741892fe6a21298fe1d2e53b07510967
1 parent
53d72ce2b0
Exists in
master
Build psycopg2 with jenkins instead
Showing 1 changed file with 3 additions and 1 deletions Inline Diff
scripts/setup_production.sh
View file @
8822360
#!/bin/bash -xe | 1 | 1 | #!/bin/bash -xe | |
2 | whoami | |||
source venv/bin/activate | 2 | 3 | source venv/bin/activate | |
source secrets | 3 | 4 | source secrets | |
pip install psycopg2 | 4 | 5 | #pip install psycopg2 | |
python manage.py migrate | 5 | 6 | python manage.py migrate | |
echo "Checking whether nginx conf was updated" | 6 | 7 | echo "Checking whether nginx conf was updated" | |
DIFF=$(diff /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available/flashy.cards) | 7 | 8 | DIFF=$(diff /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available/flashy.cards) | |
if [ "$DIFF" != "" ] | 8 | 9 | if [ "$DIFF" != "" ] | |
then | 9 | 10 | then | |
echo "Restarting nginx" | 10 | 11 | echo "Restarting nginx" | |
cp -v /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available | 11 | 12 | cp -v /srv/flashy-backend/nginxconf/flashy.cards /etc/nginx/sites-available | |
sudo /etc/init.d/nginx reload | 12 | 13 | sudo /etc/init.d/nginx reload | |
fi | 13 | 14 | fi | |
echo "Syncing static files" | 14 | 15 | echo "Syncing static files" | |
rsync -rP /srv/flashy-backend/static/ /srv/static | 15 | 16 | rsync -rP /srv/flashy-backend/static/ /srv/static | |
echo "Poking uwsgi to restart the site" | 16 | 17 | echo "Poking uwsgi to restart the site" | |
cp -v /srv/flashy-backend/flashy.ini /etc/uwsgi/ | 17 | 18 | cp -v /srv/flashy-backend/flashy.ini /etc/uwsgi/ | |
18 | 19 |