#!/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 # NOTE: ENVNAME is also the name of the user who keeps # shared data in its home directory, so it must exist! # For demo/test ENVNAMEs, see {demo,test}.sh set -eu usage() { echo "Usage: $0 ENVNAME" } if [ -z ${1+x} ]; then usage exit 1 fi ENVNAME=$1 source ~/envconfig case $ENVNAME in test) CURRENCY=TESTKUDOS ;; int) CURRENCY=INTKUDOS ;; demo) CURRENCY=KUDOS ;; *) echo Invalid envname, please use 'test' or 'int' or 'demo'. exit 1 ;; esac cd $HOME if ! test -d $HOME/gnunet; then git clone git://gnunet.org/gnunet.git fi if ! test -d $HOME/libmicrohttpd; then git clone git://gnunet.org/libmicrohttpd.git fi for component in twister bank merchant gnurl landing exchange donations blog backoffice deployment auditor survey ; do if ! test -d $HOME/$component; then git clone git://git.taler.net/$component fi done if [[ "$ENVNAME" = test ]]; then if ! test -d $HOME/playground; then git clone git://git.taler.net/playground git clone git://git.taler.net/help fi fi for component in twister bank merchant landing exchange donations blog survey backoffice ; do varname=tag_$component tag=${!varname} echo "Checking out $component to $tag" git -C $HOME/$component fetch git -C $HOME/$component checkout -q -f $tag -- done cat >$HOME/activate <