blob: acbb1c54f644b0cecb6ebe0a3200f5c8c9279932 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/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
set -eu
whoami
# 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
# build and restart
# FIXME calling 'make check' before switching still missing
if ! taler-deployment-build; then
echo "Failed to rebuild, not switching"
exit 1
else
echo "Successfully built, switching"
ln -fs -T /home/$INACTIVE/sockets /home/test/sockets
fi
taler-deployment-restart
|