From: Gabriel Cuba Date: Mon, 27 Nov 2023 18:53:23 +0000 (-0500) Subject: Feature 10997: Add OSM gitlab OCI URL for robot tests X-Git-Tag: release-v15.0-start~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=2ce240ca49553ed9d59f6d03b5d3a4592ffa353c;p=osm%2Fdevops.git Feature 10997: Add OSM gitlab OCI URL for robot tests Change-Id: I007538fd37d407bb8fa80ff3f8fcefaa8fd86546 Signed-off-by: Gabriel Cuba --- diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index dd876fce..92a3dcfd 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -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,