From fb125a1e4c40701b32f974f6eb2c46a05ca2cd78 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Mon, 17 Aug 2020 18:31:15 +0300 Subject: [PATCH] fix(install): TSDB migration should not create invalid config file (#631) Fixes #624 --- install.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 6d64c26..9343a74 100755 --- a/install.sh +++ b/install.sh @@ -126,10 +126,14 @@ replace_tsdb() { [ -f "$SENTRY_CONFIG_PY" ] && ! grep -xq 'SENTRY_TSDB = "sentry.tsdb.redissnuba.RedisSnubaTSDB"' "$SENTRY_CONFIG_PY" ); then - tsdb_settings="SENTRY_TSDB = \"sentry.tsdb.redissnuba.RedisSnubaTSDB\" + # Do NOT indent the following string as it would be reflected in the end result, + # breaking the final config file. See getsentry/onpremise#624. + tsdb_settings="\ +SENTRY_TSDB = \"sentry.tsdb.redissnuba.RedisSnubaTSDB\" - # Automatic switchover 90 days after $(date). Can be removed afterwards. - SENTRY_TSDB_OPTIONS = {\"switchover_timestamp\": $(date +%s) + (90 * 24 * 3600)}" +# Automatic switchover 90 days after $(date). Can be removed afterwards. +SENTRY_TSDB_OPTIONS = {\"switchover_timestamp\": $(date +%s) + (90 * 24 * 3600)}\ +" if grep -q 'SENTRY_TSDB_OPTIONS = ' "$SENTRY_CONFIG_PY"; then echo "Not attempting automatic TSDB migration due to presence of SENTRY_TSDB_OPTIONS"