Last active
December 23, 2015 00:48
-
-
Save rdebeasi/6555702 to your computer and use it in GitHub Desktop.
Simple deployment script for a Django app running on Heroku. This will commit and push any changes you've made to static files, so be sure to run git status before running this command.
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 | |
echo "~*~*~ IT'S GO TIME!!! ~*~*~" | |
echo "Collecting static files..." | |
python manage.py collectstatic --noinput | |
echo "Adding & committing..." | |
git add staticfiles | |
git commit -m "Collected static files." | |
# If the push to origin fails, abort the script. It's ok if the commit fails: the user might not have had any static file changes to commit. | |
set -e | |
# If your working copy is out of date, this push will fail. If that happens: pull, test, commit, push, and try again. | |
echo "Pushing to origin..." | |
git push | |
echo "Pushing to Heroku..." | |
echo "=====================" | |
git push heroku master | |
echo "Awww yeah!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment