From 695a517a2d20e85da64f02ab9604b2fff74b526e Mon Sep 17 00:00:00 2001 From: MS Date: Tue, 24 Aug 2021 22:25:13 -1100 Subject: prepare script: DB-reset is optional --- bin/taler-deployment-prepare | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/taler-deployment-prepare b/bin/taler-deployment-prepare index 347b671..f900eed 100755 --- a/bin/taler-deployment-prepare +++ b/bin/taler-deployment-prepare @@ -11,6 +11,15 @@ set -eu source "$HOME/activate" +# $1 = {yes,no} indicates WITH_DB_RESET. Defaults to no. +# Helps avoiding color Y destroying the DB while color X is in +# production. +WITH_DB_RESET=no + +if test $1 = yes; then + WITH_DB_RESET=yes +fi + if [[ -z ${TALER_ENV_NAME+x} ]]; then echo "TALER_ENV_NAME not set" exit 1 @@ -51,7 +60,9 @@ esac ## Step 1b: initialize database ## -taler-exchange-dbinit --reset +if test $WITH_DB_RESET = yes; then + taler-exchange-dbinit --reset +fi ## ## Step 2: Copy key material and update denom keys @@ -149,7 +160,9 @@ sleep 5 ## # Delete existing data from bank. -echo "yes" | taler-bank-manage django flush +if test $WITH_DB_RESET = yes; then + echo "yes" | taler-bank-manage django flush +fi case $TALER_ENV_NAME in demo|test|int|local|tanker) @@ -184,7 +197,9 @@ esac ## Step 6: Set up merchant ## -taler-merchant-dbinit --reset +if test $WITH_DB_RESET = yes; then + taler-merchant-dbinit --reset +fi # Making sure ARM is not running yet. taler-deployment-arm -e -- cgit v1.2.3