summaryrefslogtreecommitdiff
path: root/taler-build/switch_active.sh
blob: f976bffb65e9c76e104e1b7ac2a51e4e53f3dc91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Build all Taler components 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

if ! taler-deployment-build > build.log 2>&1; then
  echo "Failed to rebuild, not switching"
  if test "$1" = "--notify"; then
    mail -s "[Taler build] $(date)" --to build-failure@taler.net build.log
  fi
  exit 1
else
  echo "Successfully built, switching"
  ln -fs -T /home/$(whoami)/sockets /home/test/sockets
fi

taler-deployment-restart