From 0b3ba25d1c031b8a83b0e0c44b946d9bafa1d17c Mon Sep 17 00:00:00 2001
From: lukken <lukken@astron.nl>
Date: Thu, 21 Oct 2021 06:55:52 +0000
Subject: [PATCH] L2SS-451: Remove artifacts of testing and update
 documentation in sh files

---
 bin/dump_ConfigDb.sh         | 2 +-
 bootstrap/etc/lofar20rc.sh   | 9 ---------
 sbin/load_ConfigDb.sh        | 6 +++---
 sbin/run_integration_test.sh | 2 +-
 4 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/bin/dump_ConfigDb.sh b/bin/dump_ConfigDb.sh
index 810a644f9..0dc634c45 100755
--- a/bin/dump_ConfigDb.sh
+++ b/bin/dump_ConfigDb.sh
@@ -1,4 +1,4 @@
 #!/bin/bash
 
 # writes the JSON dump to stdout, Do not change -i into -it incompatible with gitlab ci!
-docker exec -i "${CONTAINER_NAME_PREFIX}"dsconfig python -m dsconfig.dump > "${1}"
+docker exec -i "${CONTAINER_NAME_PREFIX}"dsconfig python -m dsconfig.
diff --git a/bootstrap/etc/lofar20rc.sh b/bootstrap/etc/lofar20rc.sh
index 7f1d361e5..6e4a5c9bc 100755
--- a/bootstrap/etc/lofar20rc.sh
+++ b/bootstrap/etc/lofar20rc.sh
@@ -9,7 +9,6 @@
 # Pass a directory as first parameter to this script.  This will
 # then be used as LOFAR20_DIR.  Otherwise this file's directory
 # be used to determine the tango directory location.
-
 ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
 export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)}
 
@@ -25,14 +24,6 @@ else
     unset CONTAINER_NAME_PREFIX
 fi
 
-# This needs to be modified for a development environment.
-# Example:  ~/lofar2.0/tango
-# The current setting is for a production environment.
-export TANGO_LOFAR_LOCAL_DIR=${LOFAR20_DIR}/
-
-export TANGO_LOFAR_CONTAINER_DIR=/opt/lofar2.0/tango/
-export TANGO_LOFAR_CONTAINER_MOUNT=${TANGO_LOFAR_LOCAL_DIR}:${TANGO_LOFAR_CONTAINER_DIR}:rw
-
 # This needs to be modified for a development environment.
 # In case you run multiple Docker networks on the same host in parallel, you need to specify a unique
 # network name for each of them.
diff --git a/sbin/load_ConfigDb.sh b/sbin/load_ConfigDb.sh
index 4706aa2c9..1255f1ea1 100755
--- a/sbin/load_ConfigDb.sh
+++ b/sbin/load_ConfigDb.sh
@@ -9,10 +9,10 @@ fi
 
 # copy file into container to read it from container, as the file's location
 # in the container won't be the same as on the host.
-docker cp "${file}" dsconfig:/tmp/dsconfig-load-settings.json || exit 1
+docker cp "${file}" "${CONTAINER_NAME_PREFIX}"dsconfig:/tmp/dsconfig-update-settings.json || exit 1
 
-# write settings
-docker exec -it "${TANGO_CONTAINER_ENV}" "${CONTAINER_NAME_PREFIX}"dsconfig json2tango --write "${file}"
+# update settings, Do not change -i into -it this will break integration tests in gitlab ci!
+docker exec -i "${CONTAINER_NAME_PREFIX}"dsconfig json2tango --write --update /tmp/dsconfig-update-settings.json
 
 # somehow json2tango does not return 0 on success
 exit 0
diff --git a/sbin/run_integration_test.sh b/sbin/run_integration_test.sh
index 4327413d0..e4e22e0d7 100755
--- a/sbin/run_integration_test.sh
+++ b/sbin/run_integration_test.sh
@@ -18,7 +18,7 @@ make start databaseds dsconfig elk
 sleep 60
 
 # Update the dsconfig
-# Do not remove `bash`, otherwise statement ignored by gitlab ci!
+# Do not remove `bash`, otherwise statement ignored by gitlab ci shell!
 bash "${LOFAR20_DIR}"/sbin/update_ConfigDb.sh "${LOFAR20_DIR}"/CDB/integration_ConfigDb.json
 
 cd "$LOFAR20_DIR/docker-compose" || exit 1
-- 
GitLab