diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-01 02:33:12 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-06-01 02:33:12 +0200 |
commit | 27837be557523f7e6282ebea670450ef14f4786e (patch) | |
tree | 02af84b29336e0a4e9c2f2e587053c2898c5babf | |
parent | 8ef5283edc3c38abb05c25e76b3f8deb693af858 (diff) | |
download | deployment-27837be557523f7e6282ebea670450ef14f4786e.tar.gz deployment-27837be557523f7e6282ebea670450ef14f4786e.tar.bz2 deployment-27837be557523f7e6282ebea670450ef14f4786e.zip |
adding main logic to switch blue-green based on successful compilation
-rwxr-xr-x | taler-build/switch_active.sh | 20 |
1 files changed, 20 insertions, 0 deletions
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 |