Skip to content

Instantly share code, notes, and snippets.

@rdebeasi
Last active December 23, 2015 00:48
Show Gist options
  • Save rdebeasi/6555702 to your computer and use it in GitHub Desktop.
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.
#!/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