From 6d26a3abcf9ab9f05aa7893f16e014279222ff1b Mon Sep 17 00:00:00 2001 From: Alec Turner Date: Thu, 23 Jan 2025 09:21:06 -0800 Subject: [PATCH] reset data for 2.1 installations unless running on STRLTEST A second condition is checked for when determining whether demo data must be reset; if version '2.1' of the app is installed and the target is not node STRLTEST, data will be reset. Note that the version must be exactly '2.1', not '2.1*'. The updated version will be '2.1.1' This commit is added to handle an issue with a previously deployed version where the incorrect install script was included. Node STRLTEST was manually fixed and new data added to the database, leading to the need for this exception. --- config.json | 2 +- install.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 4a8a23ff..8f62a3c4 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "name": "streamline-emr", "org": "streamline", - "version": "2.1", + "version": "2.1.1", "platforms": [ "linux/arm64" ], diff --git a/install.sh b/install.sh index bc754000..5dc3086b 100755 --- a/install.sh +++ b/install.sh @@ -25,6 +25,7 @@ fi set -e +NODEID=$(grep ^nodeID /etc/signalytic/identity 2>/dev/null | cut -d= -f2 | xargs) APP_SLUG="streamline_emr" ORG_SLUG="streamline" INSTALL_ROOT="/var/signalytic/clientapps/${ORG_SLUG}/${APP_SLUG}" @@ -36,10 +37,15 @@ if [ -f ${INSTALL_ROOT}/stop ]; then ${INSTALL_ROOT}/stop fi -# reset data for any v1 or v2.0 installations +# reset data for any version '1.*' or '2.0*' installations if grep -q "^1." ${VERSION_FILE} || grep -q "^2.0" ${VERSION_FILE}; then echo "demo installation detected (v$(cat ${VERSION_FILE})) - resetting data" rm -rf ${DATA_ROOT} + +# reset data for version '2.1' installations, unless running on node STRLTEST +elif [ "${NODEID}" != "STRLTEST" ] && grep -q "^2.1$" ${VERSION_FILE}; then + echo "demo installation detected (v2.1) - resetting data" + rm -rf ${DATA_ROOT} fi # copy root files (if present)