From 6d351be3f9a52f2e009cb8dbf0de1b1f111409c7 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Thu, 24 Nov 2016 21:25:52 +0100 Subject: move git-checks after syntax-error checks (so you can fix your erros before deploying) --- deploy.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/deploy.sh b/deploy.sh index d1738ed..1115958 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,15 +1,5 @@ #!/bin/sh -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 -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 -fi - command -v find >/dev/null 2>&1 || { echo >&2 "I require find but it's not installed. Aborting."; exit 1; } command -v xargs >/dev/null 2>&1 || { echo >&2 "I require xargs but it's not installed. Aborting."; exit 1; } command -v php >/dev/null 2>&1 || { echo >&2 "I require php but it's not installed. Aborting."; exit 1; } @@ -20,6 +10,16 @@ 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 +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 +fi + ssh -A voc@lb.dus.c3voc.de 'sudo sh' << EOT cd /srv/nginx/streaming-website git fetch origin -- cgit v1.2.3