commit 27837be557523f7e6282ebea670450ef14f4786e parent 8ef5283edc3c38abb05c25e76b3f8deb693af858 Author: Marcello Stanisci <marcello.stanisci@inria.fr> Date: Wed, 1 Jun 2016 02:33:12 +0200 adding main logic to switch blue-green based on successful compilation Diffstat:
| M | taler-build/switch_active.sh | | | 20 | ++++++++++++++++++++ |
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git 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