Skip to content

Commit

Permalink
ensure all changes are committed and pushed before deploying
Browse files Browse the repository at this point in the history
  • Loading branch information
bronson committed May 6, 2012
1 parent 128a6cf commit b2941b6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/deploy
Expand Up @@ -304,6 +304,15 @@ require_env() {
test -z "$ENV" && abort "<env> required" test -z "$ENV" && abort "<env> required"
} }


#
# Ensure all changes are committed and pushed before deploying.
#

check_for_local_changes() {
git --no-pager diff --exit-code --quiet || abort "commit or stash your changes before deploying"
[ -z "`git rev-list @{upstream}.. -n 1 --quiet`" ] || abort "push your changes before deploying"
}

# #
# Update deploy. # Update deploy.
# #
Expand Down Expand Up @@ -350,6 +359,7 @@ while test $# -ne 0; do
done done


require_env require_env
check_for_local_changes


# deploy # deploy
deploy "${REF:-`config_get ref`}" deploy "${REF:-`config_get ref`}"

0 comments on commit b2941b6

Please sign in to comment.