Feature 10997: Add OSM gitlab OCI URL for robot tests 69/14069/3
authorGabriel Cuba <gcuba@whitestack.com>
Mon, 27 Nov 2023 18:53:23 +0000 (13:53 -0500)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 8 Dec 2023 19:03:22 +0000 (20:03 +0100)
Change-Id: I007538fd37d407bb8fa80ff3f8fcefaa8fd86546
Signed-off-by: Gabriel Cuba <gcuba@whitestack.com>
jenkins/ci-pipelines/ci_stage_3.groovy

index dd876fc..92a3dcf 100644 (file)
@@ -68,6 +68,7 @@ void run_robot_systest(String tagName,
                        String osmHostname,
                        String prometheusHostname,
                        Integer prometheusPort=null,
+                       String ociRegistryUrl,
                        String envfile=null,
                        String portmappingfile=null,
                        String kubeconfig=null,
@@ -100,12 +101,17 @@ void run_robot_systest(String tagName,
     }
 
     try {
-        sh("""docker run --env OSM_HOSTNAME=${osmHostname} --env PROMETHEUS_HOSTNAME=${prometheusHostname} \
-           ${PROMETHEUS_PORT_VAR} ${JUJU_PASSWORD_VAR} --env-file ${environmentFile} \
-           -v ${clouds}:/etc/openstack/clouds.yaml \
-           -v ${osmRSAfile}:/root/osm_id_rsa -v ${kubeconfig}:/root/.kube/config -v ${tempdir}:/robot-systest/reports \
-           -v ${portmappingfile}:/root/port-mapping.yaml ${hostfilemount} opensourcemano/tests:${tagName} \
-           -c -t ${testName}""")
+        withCredentials([usernamePassword(credentialsId: 'gitlab-oci-test', 
+                        passwordVariable: 'OCI_REGISTRY_PSW', usernameVariable: 'OCI_REGISTRY_USR')]) {
+            sh("""docker run --env OSM_HOSTNAME=${osmHostname} --env PROMETHEUS_HOSTNAME=${prometheusHostname} \
+               ${PROMETHEUS_PORT_VAR} ${JUJU_PASSWORD_VAR} --env-file ${environmentFile} \
+               --env OCI_REGISTRY_URL=${ociRegistryUrl} --env OCI_REGISTRY_USER=${OCI_REGISTRY_USR} \
+               --env OCI_REGISTRY_PASSWORD=${OCI_REGISTRY_PSW} \
+               -v ${clouds}:/etc/openstack/clouds.yaml -v ${osmRSAfile}:/root/osm_id_rsa \
+               -v ${kubeconfig}:/root/.kube/config -v ${tempdir}:/robot-systest/reports \
+               -v ${portmappingfile}:/root/port-mapping.yaml ${hostfilemount} opensourcemano/tests:${tagName} \
+               -c -t ${testName}""")
+        }
     } finally {
         sh("cp ${tempdir}/*.xml .")
         sh("cp ${tempdir}/*.html .")
@@ -185,6 +191,7 @@ node("${params.NODE}") {
     APT_PROXY = 'http://172.21.1.1:3142'
     SSH_KEY = '~/hive/cicd_rsa'
     ARCHIVE_LOGS_FLAG = false
+    OCI_REGISTRY_URL = 'oci://osm.etsi.org:5050/devops/test'
     sh 'env'
 
     tag_or_branch = params.GERRIT_BRANCH.replaceAll(/\./, '')
@@ -634,6 +641,7 @@ EOF"""
                             osmHostname,
                             prometheusHostname,
                             prometheusPort,
+                            OCI_REGISTRY_URL,
                             params.ROBOT_VIM,
                             params.ROBOT_PORT_MAPPING_VIM,
                             params.KUBECONFIG,