summaryrefslogtreecommitdiff
path: root/taler-build
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-17 23:04:26 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-06-17 23:04:26 +0200
commit9e32bbae4509d3507e3232c2373a47b109ca6b5c (patch)
tree0e5a0c01b2ac433670d2bd7e30ca887946eb4605 /taler-build
parent4fb33db4b8c14a254588f5a9064e72fa78e1b4f1 (diff)
downloaddeployment-9e32bbae4509d3507e3232c2373a47b109ca6b5c.tar.gz
deployment-9e32bbae4509d3507e3232c2373a47b109ca6b5c.tar.bz2
deployment-9e32bbae4509d3507e3232c2373a47b109ca6b5c.zip
addressing #4567
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