From: beierlm Date: Tue, 1 Feb 2022 21:46:40 +0000 (-0500) Subject: Bug 1876: Artifactory times out X-Git-Tag: v11.0.1^0 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=80c15c90576bd03f558d8402ff81e08ad7eb774e;p=osm%2Fdevops.git Bug 1876: Artifactory times out Added a lockable resource semaphore around queries to artifactory to prevent overloading the server. Fixes Bug 1876 Change-Id: I17979e7fa5d2ed2405873e7dda588d7104741817 Signed-off-by: beierlm (cherry picked from commit f83c20ab3304291aca8224ebe2dd88b58b5dc1b4) --- diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index 6a82bfc5..5d6e534c 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -212,28 +212,29 @@ node("${params.NODE}") { def upstreamComponent="" if ( params.UPSTREAM_JOB_NAME ) { println("Fetching upstream job artifact from ${params.UPSTREAM_JOB_NAME}") + lock('Artifactory') { + step ([$class: 'CopyArtifact', + projectName: "${params.UPSTREAM_JOB_NAME}", + selector: [$class: 'SpecificBuildSelector', + buildNumber: "${params.UPSTREAM_JOB_NUMBER}"] + ]) + + upstreamComponent = ci_helper.get_mdg_from_project( + ci_helper.get_env_value('build.env','GERRIT_PROJECT')) + def buildNumber = ci_helper.get_env_value('build.env','BUILD_NUMBER') + dir("$upstreamComponent") { + // the upstream job name contains suffix with the project. Need this stripped off + def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0] + def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER, + upstreamComponent, + GERRIT_BRANCH, + "${project_without_branch} :: ${GERRIT_BRANCH}", + buildNumber) - step ([$class: 'CopyArtifact', - projectName: "${params.UPSTREAM_JOB_NAME}", - selector: [$class: 'SpecificBuildSelector', - buildNumber: "${params.UPSTREAM_JOB_NUMBER}"] - ]) - - upstreamComponent = ci_helper.get_mdg_from_project( - ci_helper.get_env_value('build.env','GERRIT_PROJECT')) - def buildNumber = ci_helper.get_env_value('build.env','BUILD_NUMBER') - dir("$upstreamComponent") { - // the upstream job name contains suffix with the project. Need this stripped off - def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0] - def packages = ci_helper.get_archive(params.ARTIFACTORY_SERVER, - upstreamComponent, - GERRIT_BRANCH, - "${project_without_branch} :: ${GERRIT_BRANCH}", - buildNumber) - - packageList.addAll(packages) - println("Fetched pre-merge ${params.UPSTREAM_JOB_NAME}: ${packages}") - } + packageList.addAll(packages) + println("Fetched pre-merge ${params.UPSTREAM_JOB_NAME}: ${packages}") + } + } // lock artifactory } parallelSteps = [:] @@ -262,7 +263,9 @@ node("${params.NODE}") { } } } - parallel parallelSteps + lock('Artifactory') { + parallel parallelSteps + } /////////////////////////////////////////////////////////////////////////////////////// // Create Devops APT repository