#!/bin/bash

# Update repository
cd /var/www/website/
git checkout master
git pull

# Update python packages
virtualenvlocation=$(which virtualenvwrapper.sh)
# shellcheck source=/dev/null
source "$virtualenvlocation"
workon albertyw.com
pip install -r requirements.txt

# Configure settings
cd albertyw.com
ln -sf .env.production .env

# Restart services
sudo service nginx restart
sudo service uwsgi restart

#!/bin/bash

# Update repository
cd /var/www/website/ || exit 1
git checkout master
git pull

# Update python packages
virtualenvlocation=$(which virtualenvwrapper.sh)
# shellcheck source=/dev/null
source "$virtualenvlocation"
workon albertyw.com
pip install -r requirements.txt

# Configure settings
cd albertyw.com || exit 1
ln -sf .env.production .env

# Restart services
sudo service nginx restart
sudo service uwsgi restart

Add || exit 1 to cd
Add || exit 1 to cd
