summaryrefslogtreecommitdiff
path: root/taler-build
diff options
context:
space:
mode:
Diffstat (limited to 'taler-build')
-rwxr-xr-xtaler-build/switch_active.sh25
1 files 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