From 47faff900af77df34eab47412fa83750112efdee Mon Sep 17 00:00:00 2001
From: stedif <stefano.difrischia@inaf.it>
Date: Thu, 15 Dec 2022 17:44:55 +0100
Subject: [PATCH] L2SS-961: adjust ci-cd pipeline

---
 .gitlab-ci.yml                    | 8 ++++----
 sbin/tag_and_push_docker_image.sh | 2 +-
 setup.sh                          | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 46b110943..a660cf080 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -49,9 +49,9 @@ trigger_prepare:
     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
     - touch /root/.Xauthority
     #    Hack BASH_SOURCE into sourced files, docker its sh shell won't set this
-    - export BASH_SOURCE=$(pwd)/bootstrap/etc/lofar20rc.sh
+    - export BASH_SOURCE=$(pwd)/setup.sh
     #    source the lofarrc file and mask its non zero exit code
-    - . bootstrap/etc/lofar20rc.sh || true
+    - . setup.sh || true
 ##    Allow docker image script to execute
 #    - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
 
@@ -661,11 +661,11 @@ integration_test_docker:
   script:
     - touch /root/.Xauthority
     #    Hack BASH_SOURCE into sourced files, docker its sh shell won't set this
-    - export BASH_SOURCE=$(pwd)/bootstrap/etc/lofar20rc.sh
+    - export BASH_SOURCE=$(pwd)/setup.sh
     #    Hack HOSTNAME env variable into host.docker.internal, set in docker-compose
     - export HOSTNAME=host.docker.internal
     #    source the lofarrc file and mask its non zero exit code
-    - . bootstrap/etc/lofar20rc.sh || true
+    - . setup.sh || true
     #    TANGO_HOST must be unset our databaseds will be unreachable
     - unset TANGO_HOST
     #    Do not remove 'bash' or statement will be ignored by primitive docker shell
diff --git a/sbin/tag_and_push_docker_image.sh b/sbin/tag_and_push_docker_image.sh
index 934681d21..fe20f1779 100755
--- a/sbin/tag_and_push_docker_image.sh
+++ b/sbin/tag_and_push_docker_image.sh
@@ -43,7 +43,7 @@ while getopts ${optstring} arg; do
 done
 
 if [ -z "${LOFAR20_DIR+x}" ]; then
-  echo "LOFAR20_DIR not set, did you forget to source lofar20rc.sh?"
+  echo "LOFAR20_DIR not set, did you forget to source setup.sh?"
   exit 1
 fi
 
diff --git a/setup.sh b/setup.sh
index 17e98b131..23a98f323 100644
--- a/setup.sh
+++ b/setup.sh
@@ -13,7 +13,7 @@
 # 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}/../..)}
+export LOFAR20_DIR=${1:-${ABSOLUTE_PATH}}
 
 if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
   alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
-- 
GitLab