From 8f2df0a5b85fb8947999aad27fb98cd1392e1ef0 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Tue, 20 Dec 2016 22:30:58 +0100 Subject: allow to override deployment-checks --- deploy.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh index 5f409a8..4a61dac 100755 --- a/deploy.sh +++ b/deploy.sh @@ -10,14 +10,22 @@ if [ $? -ne 0 ]; then exit 1 fi -if [ `git rev-parse --verify origin/master` != `git rev-parse --verify master` ]; then - echo "You have commits on the master branch not pushed to origin yet. They would not be deployed. aborting" - exit 2 +if [ `git rev-parse --verify origin/$DEPLOY_BRANCH` != `git rev-parse --verify $DEPLOY_BRANCH` ]; then + echo "You have commits on the master branch not pushed to origin yet. They would not be deployed." + echo "do you still which to deploy what's already in the repo? then type yes" + read -p "" input + if [ "x$input" != "xyes" ]; then + exit 2 + fi fi if ! (git diff --exit-code >/dev/null || git diff --cached --exit-code >/dev/null); then - echo "You have uncomitted changes. They would not be deployed. aborting" - exit 2 + echo "You have uncomitted changes. They would not be deployed." + echo "do you still which to deploy what's already in the repo? then type yes" + read -p "" input + if [ "x$input" != "xyes" ]; then + exit 2 + fi fi ssh -A voc@lb.dus.c3voc.de 'sudo sh' << EOT -- cgit v1.2.3