summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/taler-deployment-prepare21
1 files changed, 18 insertions, 3 deletions
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