Last active
August 29, 2015 14:19
-
-
Save tom-henderson/df2296e49d34eacfddb0 to your computer and use it in GitHub Desktop.
Django deploy script
This file contains hidden or 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/bash | |
| echo "Activating virtualenv" | |
| source /home/django/.virtualenvs/my_app/bin/activate | |
| source /home/django/.virtualenvs/my_app/bin/postactivate | |
| which python | |
| echo | |
| echo "Fetching master branch" | |
| cd /opt/my_app | |
| git pull | |
| echo | |
| echo "Updating requirements" | |
| pip install -r requirements/production.txt | |
| echo | |
| echo "Running migrations" | |
| python manage.py migrate --noinput | |
| echo | |
| echo "Collect static files" | |
| python manage.py collectstatic --noinput | |
| echo | |
| echo "Reloading apache" | |
| sudo service apache2 reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment