taler-deployment

Deployment scripts and configuration files
Log | Files | Refs | README

commit 9e32bbae4509d3507e3232c2373a47b109ca6b5c
parent 4fb33db4b8c14a254588f5a9064e72fa78e1b4f1
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date:   Fri, 17 Jun 2016 23:04:26 +0200

addressing #4567

Diffstat:
Mtaler-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 @@ -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