diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-05-19 18:51:15 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-05-19 18:51:15 +0200 |
commit | 9c110443e261c1ec7c467b30dd62f6adde9a0ea1 (patch) | |
tree | f77803762efe84b566830b24443661426e2bbeec /bootstrap-bluegreen | |
parent | eaad67b57b35e5523d2ae76dd6db157a3175431e (diff) | |
download | deployment-9c110443e261c1ec7c467b30dd62f6adde9a0ea1.tar.gz deployment-9c110443e261c1ec7c467b30dd62f6adde9a0ea1.tar.bz2 deployment-9c110443e261c1ec7c467b30dd62f6adde9a0ea1.zip |
generic bootstrap
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" |