Created
March 15, 2018 01:53
-
-
Save ninapavlich/6f90f4b38ed2eaf486466003d45a5032 to your computer and use it in GitHub Desktop.
Manually deploy python project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
GIT_DIR="/srv/project-name/src/" | |
#First update the repo | |
git --git-dir=$GIT_DIR.git --work-tree=$GIT_DIR fetch | |
git --git-dir=$GIT_DIR.git --work-tree=$GIT_DIR reset --hard origin/master | |
echo "Pulled latest code from origin/master" | |
#Manage virtual environment | |
/srv/project-name/venv/bin/pip install -r /srv/project-name/src/requirements.txt | |
echo "Updated virtual environment" | |
#Update database | |
/srv/project-name/venv/bin/python /srv/project-name/src/manage.py migrate | |
echo "Migrated" | |
#Restart | |
sudo systemctl restart emperor.uwsgi | |
echo "Restarted emperor.uwsgi" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment