Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
######################################################
# Deploys working repository to git deployment branch
######################################################
#get the status of the working repository
status=`git status --porcelain`
#check if the working repository is clean
if [ "$status" = "" ]
then
echo `git branch -f deployment`
echo `git push origin deployment`
echo "OK. Done deploying to git deployment branch."
exit 0 #success
else
echo `git status`
echo "Error. Working repository is not clean. Commit your changes..."
exit 1 #failure
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment