diff options
Diffstat (limited to 'bootstrap-bluegreen')
-rwxr-xr-x | bootstrap-bluegreen | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/bootstrap-bluegreen b/bootstrap-bluegreen new file mode 100755 index 0000000..5f15aaf --- /dev/null +++ b/bootstrap-bluegreen @@ -0,0 +1,61 @@ +#!/bin/bash + +# Bootstrap the Taler setup for the user account that +# is currently logged in. + +# The setup generated by this script is suitable for +# blue-green deployments, where two users run +# identical environments, and traffic can be switched +# between them. + +# To create a demo setup, run +# demo-blue$ ~/deployment/bootstrap-bluegreen demo +# demo-green$ ~/deployment/bootstrap-bluegreen demo + +# There MUST be a user with the same name +# as the deployment basename to share data +# between the blue/red deployment. + +set -eu + +usage() { + echo "$0: DEPLOYMENT_BASENAME" +} + +if [ -z ${1+x} ]; then + usage + exit 1 +fi + +DEPLOYMENT_BASENAME=$1 + +cd $HOME + +if ! test -d $HOME/gnunet; then + svn checkout https://gnunet.org/svn/gnunet +fi + +if ! test -d $HOME/libmicrohttpd; then + svn checkout https://gnunet.org/svn/libmicrohttpd +fi + +for component in bank merchant gnurl landing exchange merchant-frontends deployment; do + if ! test -d $HOME/$component; then + git clone /var/git/$component.git + fi +done + +for component in bank merchant landing exchange merchant-frontends; do + git -C $HOME/$component checkout stable +done + +cat >$HOME/activate <<EOL +#!/bin/bash +export PATH="$HOME/local/bin:$HOME/deployment/bin:\$PATH" +EOL + +mkdir -p $HOME/.config +ln -sft $HOME/.config "$HOME/deployment/config/$DEPLOYMENT_BASENAME.taler.net/taler.conf" +ln -sft $HOME/.config "$HOME/deployment/config/$DEPLOYMENT_BASENAME.taler.net/taler" + +ln -sf "/home/$DEPLOYMENT_BASENAME/shared-data" "$HOME" |