X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_helper.groovy;h=9708b1c8a0ac6a2018188837a9407aebaffbe36f;hb=ae8b04e946f0e8028eaf49b87858582c46487004;hp=d058099c093612bd1d9299eba209bfca8f16916e;hpb=3a0fc42d6a01912debb9e8fbcff8a89d111ded72;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_helper.groovy b/jenkins/ci-pipelines/ci_helper.groovy index d058099c..9708b1c8 100644 --- a/jenkins/ci-pipelines/ci_helper.groovy +++ b/jenkins/ci-pipelines/ci_helper.groovy @@ -20,19 +20,23 @@ def get_archive(artifactory_server, mdg, branch, build_name, build_number, patte println("retrieve archive for ${mdg}/${branch}/${build_name}/${build_number}/${pattern}") + // if the build name does not contain merge, then this is a patchset/staging job + if (!build_name.contains('merge')) { + branch += '-staging' + } def repo_prefix = 'osm-' def downloadSpec = """{ "files": [ { "target": "./", - "pattern": "${repo_prefix}${mdg}/${branch}/${pattern}", + "pattern": "${repo_prefix}${mdg}/${branch}/${build_number}/${pattern}", "build": "${build_name}/${build_number}" } ] }""" server.download(downloadSpec) - // workaround. flatten and repo the specific build num from the directory + // workaround. flatten repo to remove specific build num from the directory sh "cp -R ${branch}/${build_num}/* ." sh "rm -rf ${branch}/${build_num}" } @@ -87,30 +91,36 @@ def get_ip_from_container( container_name ) { def archive(artifactory_server,mdg,branch,status) { server = Artifactory.server artifactory_server - def properties = "branch=${branch};status=${status}" + def properties = "" + //def properties = "branch=${branch};status=${status}" def repo_prefix = 'osm-' + + // if the build name does not contain merge, then this is a patchset/staging job + if ( !JOB_NAME.contains('merge') ) { + branch += '-staging' + } def uploadSpec = """{ "files": [ { - "pattern": "changelog/*", + "pattern": "dists/*.gz", "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", "props": "${properties}", "flat": false }, { - "pattern": "dists/*.gz", + "pattern": "dists/*Packages", "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", "props": "${properties}", "flat": false }, { - "pattern": "dists/*Packages", + "pattern": "pool/*/*.deb", "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", "props": "${properties}", "flat": false }, { - "pattern": "pool/*/*.deb", + "pattern": "changelog/*", "target": "${repo_prefix}${mdg}/${branch}/${BUILD_NUMBER}/", "props": "${properties}", "flat": false