Modify CSIT script to have absolute root path env 18/133118/4
authoremaclee <lee.anjella.macabuhay@est.tech>
Thu, 2 Feb 2023 10:58:35 +0000 (10:58 +0000)
committerLee Anjella Macabuhay <lee.anjella.macabuhay@est.tech>
Thu, 2 Feb 2023 12:29:46 +0000 (12:29 +0000)
        - change set up to call docker compose for cps-ncmp
        - add root as a property in 'test.properties'
        - root is specified to be root directory folder for the current
          project
        - modified docker compose init container to use ROOT env var

Issue-ID: CPS-1472
Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
Change-Id: Ie5ac6bbff7cb1e761501bd0db8447f86af06b95f

csit/plans/cps/setup.sh
csit/plans/cps/test.properties
csit/run-project-csit.sh
docker-compose/docker-compose.yml

index 43575f9..c715da1 100755 (executable)
@@ -57,9 +57,7 @@ source $WORKSPACE/plans/cps/test.properties
 export $(cut -d= -f1 $WORKSPACE/plans/cps/test.properties)
 
 ###################### setup cps-ncmp ############################
-mkdir -p $WORKSPACE/archives/dc-cps
-cp $WORKSPACE/../docker-compose/*.yml $WORKSPACE/archives/dc-cps
-cd $WORKSPACE/archives/dc-cps
+cd $CPS_HOME/docker-compose
 
 curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > docker-compose
 chmod +x docker-compose
index 9e22362..6a715f7 100644 (file)
@@ -27,3 +27,5 @@ DMI_VERSION=1.3.0-SNAPSHOT-latest
 
 ADVISED_MODULES_SYNC_SLEEP_TIME_MS=2000
 CMHANDLE_DATA_SYNC_SLEEP_TIME_MS=2000
+
+CPS_HOME=$CPS_HOME
\ No newline at end of file
index a231c5e..fcb3c92 100755 (executable)
@@ -21,6 +21,7 @@
 # $1 test options (passed on to run-csit.sh as such)
 
 export TESTOPTIONS=${1}
+export CPS_HOME=$(git rev-parse --show-toplevel)
 export WORKSPACE=$(git rev-parse --show-toplevel)/csit
 
 rm -rf ${WORKSPACE}/archives
index 7d6379a..dd7749a 100644 (file)
@@ -110,13 +110,12 @@ services:
     restart: unless-stopped
 
   init-db:
-    build: ../../../docker-compose/initfile
+    build: ${CPS_HOME:-.}/docker-compose/initfile
     environment:
       CPS_CORE_PORT: ${CPS_CORE_PORT:-8883}
       CPS_CORE_MANAGEMENT_PORT: ${CPS_CORE_MANAGEMENT_PORT:-8887}
     volumes:
-      - ./initfile:/initfile
-      - ../../../cps-ncmp-service/src/main/resources/model/:/model
+      - ${CPS_HOME:-.}/cps-ncmp-service/src/main/resources/model/:/model
     depends_on:
       cps-and-ncmp:
         condition: service_started