From 9e32bbae4509d3507e3232c2373a47b109ca6b5c Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 17 Jun 2016 23:04:26 +0200 Subject: addressing #4567 --- taler-build/switch_active.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/taler-build/switch_active.sh b/taler-build/switch_active.sh index a16cad0..487a83f 100755 --- a/taler-build/switch_active.sh +++ b/taler-build/switch_active.sh @@ -12,24 +12,23 @@ set -eu ACTIVE=$(readlink /home/test/sockets | awk -F/ '{print $3}') # exit if active -if [[ $(whoami) == $ACTIVE ]] -then -exit +if [[ $(whoami) == $ACTIVE ]]; then + exit fi -if [[ 'test-green' == $ACTIVE ]] -then -INACTIVE='test-blue' +if [[ 'test-green' == $ACTIVE ]]; then + INACTIVE='test-blue' else -INACTIVE='test-green' + INACTIVE='test-green' fi # build and restart # FIXME calling 'make check' before switching still missing -taler-deployment-build -taler-deployment-restart - -# check exit code -if [[ $? == 0 ]] -then ln -fs -T /home/$INACTIVE/sockets /home/test/sockets +if taler-deployment-build; ! test $? = 0; then + echo "Failed to rebuild, not switching" +else + echo "Successfully built, switching" + ln -fs -T /home/$INACTIVE/sockets /home/test/sockets fi + +taler-deployment-restart -- cgit v1.2.3