#!/bin/bash # Build all Taler components (currently only the wallet build+test is # not supported) for the non active party of blue-green, and switch to # 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}'` # exit if active if [[ `whoami` == $ACTIVE ]] then exit fi 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 taler-deployment-restart # check exit code if [[ $? == 0 ]] then ln -fs -T /home/$INACTIVE/sockets /home/test/sockets fi