diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-01-22 15:03:13 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-01-22 15:03:13 +0100 |
commit | a03ef9cc605629d2bd38b707d037b4b2890718d5 (patch) | |
tree | 75cc16b7a362ad50c61015981052bc70567e7e97 /bin/taler-deployment-prepare | |
parent | 5f74af3124f2d7088800a7904aa5a9a2c1a0eae3 (diff) | |
download | deployment-a03ef9cc605629d2bd38b707d037b4b2890718d5.tar.gz deployment-a03ef9cc605629d2bd38b707d037b4b2890718d5.tar.bz2 deployment-a03ef9cc605629d2bd38b707d037b4b2890718d5.zip |
use prepare script
Diffstat (limited to 'bin/taler-deployment-prepare')
-rwxr-xr-x | bin/taler-deployment-prepare | 84 |
1 files changed, 69 insertions, 15 deletions
diff --git a/bin/taler-deployment-prepare b/bin/taler-deployment-prepare index dae504d..463163b 100755 --- a/bin/taler-deployment-prepare +++ b/bin/taler-deployment-prepare @@ -1,9 +1,15 @@ #!/bin/bash +# Prepare a deployment for execution: +# * generate the configuration +# * put keys in the right place +# * sign the exchange's wire response +# * run some sanity checks (FIXME: not done yet!) + set -eu usage() { - echo "Usage: $0 ENVNAME" + echo "Usage: $0" } if [ -z ${1+x} ]; then @@ -11,25 +17,73 @@ if [ -z ${1+x} ]; then exit 1 fi -$HOME/deployment/bootstrap-taler $1 - source $HOME/activate -taler-deployment-build -echo "All Taler built." - -taler-deployment-generate-config -echo "Configuration got generated." +if [[ -z ${TALER_ENV_NAME+x} ]]; then + echo "TALER_ENV_NAME not set" + exit 1 +fi -if test "demo" = $1; then - echo "Please set up manually the shared data between demo-blue/green" - exit 0 +if [[ -z ${TALER_CONFIG_CURRENCY+x} ]]; then + echo "TALER_CONFIG_CURRENCY not set" + exit 1 fi +function generate_config() { + EXCHANGE_PUB=$(gnunet-ecc -p $HOME/deployment/private-keys/${TALER_ENV_NAME}-exchange-master.priv) + + mkdir -p $HOME/.config + + $HOME/deployment/config/generate-config \ + --exchange-pub "$EXCHANGE_PUB" \ + --currency "$TALER_CONFIG_CURRENCY" \ + --outdir $HOME/.config \ + --envname "$TALER_ENV_NAME" +} + +## +## Step 1: Generate config +## + +case $TALER_ENV_NAME in + demo|test|int) + generate_config + ;; + *) + echo "Not generating config for env $TALER_ENV_NAME" + ;; +esac + taler-deployment-keyup -echo "Keys generated." -taler-deployment-sign -echo "/wire response signed." -echo "All services can be launched with taler-deployment-start now." +## +## Step 2: Copy key material and update denom keys +## + + +case $TALER_ENV_NAME in + demo|test|int) + generate_config + ;; + *) + echo "Not copying private keys for env $TALER_ENV_NAME" + ;; +esac + +taler-exchange-keyup + + +## +## Step 3: Sign the exchange's wire information +## + +WIRE_RESPONSE=$(taler-config -s exchange-account-1 -o wire_response -f) + +if test -e "$WIRE_RESPONSE"; then + echo "Will not override that wire response file ($WIRE_RESPONSE); exiting." + exit 0 +fi + +taler-exchange-wire +chmod 770 $WIRE_RESPONSE |