Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ensure all changes are committed and pushed before deploying

  • Loading branch information...
commit b2941b67aeac21cb9639dbc886f60e21dbb9c773 1 parent 128a6cf
@bronson bronson authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 bin/deploy
View
10 bin/deploy
@@ -305,6 +305,15 @@ require_env() {
}
#
+# 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.
#
@@ -350,6 +359,7 @@ while test $# -ne 0; do
done
require_env
+check_for_local_changes
# deploy
deploy "${REF:-`config_get ref`}"
Please sign in to comment.
Something went wrong with that request. Please try again.