Skip to content

Instantly share code, notes, and snippets.

@pgib
Created May 23, 2012 18:32
Show Gist options
  • Save pgib/2776901 to your computer and use it in GitHub Desktop.
Save pgib/2776901 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
current_branch=`git branch|grep \*|awk '{ print $2 }'`
if [ $current_branch != "soup" ]; then
git checkout soup
fi
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"
}
@JulianJorgensen
Copy link

"git push soup upstream" should be "git push upstream soup", no?

@drlube
Copy link

drlube commented May 23, 2012

shouldn't it be:
git push upstream soup (on line 8)

@pgib
Copy link
Author

pgib commented May 23, 2012

fixed

@eddanger
Copy link

@flyingoctopus
Copy link

maybe add

echo "checking out soup in $ayv_deploy_dir"

after line 21.

@pgib
Copy link
Author

pgib commented Jun 7, 2012

Or only checkout soup if necessary. Grab the update while it's still hot!

@eddanger
Copy link

eddanger commented Jun 7, 2012

Can you add instructions for creating the deploy repo again... I lost/broke mine

@drlube
Copy link

drlube commented Apr 5, 2013

soup is now staging! Mmmmmmmm staging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment