-
-
Save flyingoctopus/2892271 to your computer and use it in GitHub Desktop.
Put this soup in your .bash_profile and smoke (or slurp) it!
This file contains 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
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