From 27837be557523f7e6282ebea670450ef14f4786e Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 1 Jun 2016 02:33:12 +0200 Subject: adding main logic to switch blue-green based on successful compilation --- taler-build/switch_active.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/taler-build/switch_active.sh b/taler-build/switch_active.sh index 1390899..2555ad8 100755 --- a/taler-build/switch_active.sh +++ b/taler-build/switch_active.sh @@ -5,3 +5,23 @@ # it whenever compilation and testing succeed. # The script is not portable to system using different usernames and directories, # respect to taler.net, for blue-green deployments + +# figure out which is the inactive +ACTIVE=`readlink /home/test/sockets | awk -F/ '{print $3}'` +if [[ 'test-green' == $ACTIVE ]] +then +INACTIVE='test-blue' +else +INACTIVE='test-green' +fi + +# global build for the inactive +cd /home/$INACTIVE +source activate +# FIXME calling 'make check' before switching still missing +taler-deployment-build + +# check exit code +if [[ $? == 0 ]] +then ln -fs -T /home/$INACTIVE/sockets /home/test/sockets +fi -- cgit v1.2.3