Created
April 30, 2013 19:25
-
-
Save fny/5491227 to your computer and use it in GitHub Desktop.
Quick n' dirty Heroku pushes.
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
| #! /usr/bin/env bash | |
| set -e | |
| repo_dir=`pwd` | |
| current_branch=`git rev-parse --abbrev-ref HEAD` | |
| timestamp=`date +"%Y%m%d%H%M"` | |
| push_dir="heroku-$timestamp" | |
| echo "Copying the repository into $push_dir for pushing..." | |
| cd ../ | |
| cp -R "$repo_dir" "$push_dir" | |
| echo "Entering $push_dir ..." | |
| cd $push_dir | |
| echo "Trimming Gemfile..." | |
| sed -i '' -e '/group :development, :test do/,$d' Gemfile | |
| echo "Unignoring seed data..." | |
| sed -i '' -e 's|/db/seeds/data/||' .gitignore | |
| echo "Preparing for takeoff..." | |
| bundle | |
| git add . | |
| git commit -am "Push at $timestamp" | |
| echo "We have ignition..." | |
| git push -f heroku $current_branch:master | |
| echo "Cleaning up..." | |
| cd ../ | |
| rm -Rf "heroku-$timestamp" | |
| cd $repo_dir | |
| finish_message="Yay I'm so excited! I just can't hide it!" | |
| command -v say >/dev/null 2>&1 && say $finish_message | |
| echo $finish_message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment