commit c13456dc14116b73a47dc923812b4bb42cbf765c
parent 8f6ab7275341ad1e87626910e5264857a5f70c5b
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Wed, 26 Jun 2019 23:59:02 +0200
Make bootstrap script color-agnostic.
Diffstat:
| D | bootstrap-bluegreen | | | 112 | ------------------------------------------------------------------------------- |
| D | bootstrap-standalone | | | 78 | ------------------------------------------------------------------------------ |
| A | bootstrap-taler | | | 109 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
3 files changed, 109 insertions(+), 190 deletions(-)
diff --git a/bootstrap-bluegreen b/bootstrap-bluegreen
@@ -1,112 +0,0 @@
-#!/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 ENVCOLOR"
-}
-
-if [ -z ${1+x} ]; then
- usage
- exit 1
-fi
-
-if [ -z ${2+x} ]; then
- usage
- exit 1
-fi
-
-ENVNAME=$1
-ENVCOLOR=$2
-BRANCH=master
-CURRENCY=TESTKUDOS
-
-case $ENVNAME in
- demo)
- BRANCH=stable
- CURRENCY=KUDOS
- ;;
-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
- echo "Checking out $component to $BRANCH"
- git -C $HOME/$component checkout $BRANCH
-done
-
-cat >$HOME/activate <<EOL
-#!/bin/bash
-
-function taler-config-generate () {
- echo "Command disabled. Please use taler-deployment-config-generate instead."
- return 1
-}
-function taler-exchange-keyup () {
- echo "Command disabled. Please use taler-deployment-keyup instead."
-}
-
-
-export PATH="$HOME/deployment/bin:$HOME/local/bin:\$PATH"
-export PYTHONPATH="$HOME/local/lib/python3.5/site-packages"
-export TALER_CHECKDB="postgres:///talercheck-$USER"
-export TALER_CONFIG_CURRENCY=$CURRENCY
-
-# DEPRECATED ALIAS!
-export TALER_CONFIG_ENV=$ENVNAME
-
-export TALER_ENV_NAME=$ENVNAME
-export TALER_ENV_COLOR=$ENVCOLOR
-export TALER_ENV_URL_INTRO="https://$ENVNAME.taler.net/"
-export TALER_ENV_URL_BANK="https://bank.$ENVNAME.taler.net/"
-export TALER_ENV_URL_MERCHANT_BLOG="https://shop.$ENVNAME.taler.net/"
-export TALER_ENV_URL_MERCHANT_DONATIONS="https://donations.$ENVNAME.taler.net/"
-export TALER_ENV_URL_MERCHANT_SURVEY="https://survey.$ENVNAME.taler.net/"
-export TALER_ENV_URL_AUDITOR="https://auditor.$ENVNAME.taler.net/"
-export TALER_ENV_URL_BACKOFFICE="https://backoffice.$ENVNAME.taler.net/"
-EOL
-
-ln -sf "/home/$ENVNAME/shared-data" "$HOME"
-
-mkdir -p "$HOME/sockets"
-mkdir -p "$HOME/stamps"
-
-ln -sf ../deployment/taler-build/Makefile stamps/
-ln -sf ../deployment/taler-build/invalidate.sh stamps/
diff --git a/bootstrap-standalone b/bootstrap-standalone
@@ -1,78 +0,0 @@
-#!/bin/bash
-
-# Bootstrap the Taler setup for the user account that
-# is currently logged in.
-
-# Generates a setup for a single user,
-# including a postgresql DB.
-
-set -eu
-
-ENVNAME=$USER
-BRANCH=master
-CURRENCY=$(echo "KUDOS-$USER" | cut -c 1-11)
-PGBINDIR=$(pg_config --bindir)
-
-cd $HOME
-
-if ! test -d $HOME/gnunet; then
- git clone git://git.gnunet.org/gnunet.git
-fi
-
-if ! test -d $HOME/libmicrohttpd; then
- git clone git://git.gnunet.org/libmicrohttpd.git
-fi
-
-for component in twister bank merchant gnurl landing exchange donations blog deployment survey auditor backoffice ; do
- if ! test -d $HOME/$component; then
- git clone git://git.taler.net/$component.git
- fi
-done
-
-for component in twister bank merchant landing exchange donations blog survey auditor backoffice ; do
- echo "Checking out $component to $BRANCH"
- git -C $HOME/$component checkout $BRANCH
-done
-
-if ! test -d $HOME/talerdb; then
- $PGBINDIR/initdb -D talerdb -U $USER
-fi
-
-mkdir -p $HOME/sockets
-
-$PGBINDIR/postgres --single -D ~/talerdb -k $HOME/sockets -h "" postgres \
- >/dev/null <<< "create database taler"
-$PGBINDIR/postgres --single -D ~/talerdb -k $HOME/sockets -h "" postgres \
- >/dev/null <<< "create database talercheck"
-
-cat >$HOME/activate <<EOL
-#!/bin/bash
-
-function taler-config-generate () {
- echo "Command disabled. Please use taler-deployment-config-generate instead."
- return 1
-}
-function taler-exchange-keyup () {
- echo "Command disabled. Please use taler-deployment-keyup instead."
-}
-
-export PATH="$HOME/deployment/bin:$HOME/local/bin:\$PATH"
-export PYTHONPATH="$HOME/local/lib/python3.5/site-packages"
-export TALER_CHECKDB="postgres:///talercheck?host=$HOME/sockets"
-export TALER_CONFIG_CURRENCY=$CURRENCY
-export TALER_CONFIG_STANDALONE=1
-
-# DEPRECATED ALIAS!
-export TALER_CONFIG_ENV=$ENVNAME
-
-export TALER_ENV_NAME=$ENVNAME
-export TALER_CONFIG_DB="postgres:///taler?host=$HOME/sockets"
-export TALER_ENV_URL_INTRO="https://env.taler.net/$ENVNAME/"
-export TALER_ENV_URL_BANK="https://env.taler.net/$ENVNAME/bank"
-export TALER_ENV_URL_MERCHANT_BLOG="https://env.taler.net/$ENVNAME/shop"
-export TALER_ENV_URL_MERCHANT_DONATIONS="https://env.taler.net/$ENVNAME/donations"
-export TALER_ENV_URL_MERCHANT_SURVEY="https://env.taler.net/$ENVNAME/survey"
-export TALER_ENV_URL_AUDITOR="https://env.taler.net/$ENVNAME/auditor"
-export TALER_ENV_URL_BACKOFFICE="https://env.taler.net/$ENVNAME/backoffice"
-export TALER_ACTIVATED=1
-EOL
diff --git a/bootstrap-taler b/bootstrap-taler
@@ -0,0 +1,109 @@
+#!/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
+
+if [ -z ${2+x} ]; then
+ usage
+ exit 1
+fi
+
+ENVNAME=$1
+BRANCH=master
+CURRENCY=TESTKUDOS
+
+case $ENVNAME in
+ demo)
+ BRANCH=stable
+ CURRENCY=KUDOS
+ ;;
+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
+ echo "Checking out $component to $BRANCH"
+ git -C $HOME/$component checkout $BRANCH
+done
+
+cat >$HOME/activate <<EOL
+#!/bin/bash
+
+function taler-config-generate () {
+ echo "Command disabled. Please use taler-deployment-config-generate instead."
+ return 1
+}
+function taler-exchange-keyup () {
+ echo "Command disabled. Please use taler-deployment-keyup instead."
+}
+
+
+export PATH="$HOME/deployment/bin:$HOME/local/bin:\$PATH"
+export PYTHONPATH="$HOME/local/lib/python3.5/site-packages"
+export TALER_CHECKDB="postgres:///talercheck-$USER"
+export TALER_CONFIG_CURRENCY=$CURRENCY
+
+# DEPRECATED ALIAS!
+export TALER_CONFIG_ENV=$ENVNAME
+
+export TALER_ENV_NAME=$ENVNAME
+export TALER_ENV_URL_INTRO="https://$ENVNAME.taler.net/"
+export TALER_ENV_URL_BANK="https://bank.$ENVNAME.taler.net/"
+export TALER_ENV_URL_MERCHANT_BLOG="https://shop.$ENVNAME.taler.net/"
+export TALER_ENV_URL_MERCHANT_DONATIONS="https://donations.$ENVNAME.taler.net/"
+export TALER_ENV_URL_MERCHANT_SURVEY="https://survey.$ENVNAME.taler.net/"
+export TALER_ENV_URL_AUDITOR="https://auditor.$ENVNAME.taler.net/"
+export TALER_ENV_URL_BACKOFFICE="https://backoffice.$ENVNAME.taler.net/"
+EOL
+
+mkdir -p "$HOME/sockets"
+mkdir -p "$HOME/stamps"
+mkdir -p "$HOME/taler-data"
+
+ln -sf ../deployment/taler-build/Makefile stamps/
+ln -sf ../deployment/taler-build/invalidate.sh stamps/