Skip to content

Instantly share code, notes, and snippets.

@rShetty
Last active January 3, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rShetty/8516068 to your computer and use it in GitHub Desktop.
Save rShetty/8516068 to your computer and use it in GitHub Desktop.
Deploy Script For Yelloday Servers
#!/bin/bash
# Bash Script to automate deploying to Heroku staging and dev servers for yelloday
usage="$(basename "$0") commit-message dev|staging-- Push to Development/Staging Server Heroku"
if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]] ; then
echo "$usage"
else
git stash
git checkout master
git pull origin master
git add -A .
git commit -m '$1'
if [[ "$2" == 'dev' ]]; then
git push -f yelloday-dev master
heroku run rake db:migrate RAILS_ENV=staging --app=yelloday-dev
elif [[ "$2" == 'staging' ]]
then
git push -f heroku master
heroku run rake db:migrate RAILS_ENV=staging --app=yelloday-staging
else
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment