Skip to content

Instantly share code, notes, and snippets.

@flyingoctopus
Forked from pgib/make_soup.sh
Created June 7, 2012 23:10
Show Gist options
  • Save flyingoctopus/2892271 to your computer and use it in GitHub Desktop.
Save flyingoctopus/2892271 to your computer and use it in GitHub Desktop.
Put this soup in your .bash_profile and smoke (or slurp) it!
ayv_deploy_dir="/Users/${USER}/Sites/ayv/deploy"
make_soup()
{
current_branch=`git status | head -n 1 | awk '{print $4}'`
echo "Pushing $current_branch to soup... (Press Ctrl-c to abort)"
sleep 2
git checkout soup
git fetch upstream && git merge upstream/soup
git merge $current_branch && git push upstream soup || git reset --hard
git checkout $current_branch
}
serve_soup()
{
if [ ! -d $ayv_deploy_dir ]; then
echo "You need to clone the project to $ayv_deploy_dir."
return
fi
cd $ayv_deploy_dir
git checkout soup
git fetch origin && git merge origin/soup
/bin/echo -n "Deploy with pipeline? [Y/n]: "
read pipeline
deploy="deploy:staging"
case $pipeline in
N*|n*)
deploy="'deploy:staging[nopipeline]'"
;;
esac
bundle exec rake "$deploy"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment