- container_name += "-${BUILD_NUMBER}"
-
- // Copy the artifacts from the upstream jobs
- stage("Copy Artifacts") {
- // cleanup any previous repo
- sh 'rm -rf repo'
- dir("repo") {
- // grab all stable upstream builds based on the
-
- dir("${RELEASE}") {
- //def list = ["RO", "openvim", "osmclient", "IM", "devops", "MON", "N2VC", "NBI", "common", "LCM", "POL", "LW-UI", "NG-UI", "PLA", "tests"]
- def list = ["RO", "openvim", "osmclient", "IM", "devops", "MON", "N2VC", "NBI", "common", "LCM", "POL", "NG-UI", "PLA", "tests"]
- for (component in list) {
- step ([$class: 'CopyArtifact',
- projectName: "${component}${upstream_main_job}/${GERRIT_BRANCH}"])
-
- // grab the build name/number
- //options = get_env_from_build('build.env')
- build_num = ci_helper.get_env_value('build.env','BUILD_NUMBER')
-
- // grab the archives from the stage_2 builds (ie. this will be the artifacts stored based on a merge)
- ci_helper.get_archive(params.ARTIFACTORY_SERVER,component,GERRIT_BRANCH, "${component}${upstream_main_job} :: ${GERRIT_BRANCH}", build_num)
-
- // cleanup any prevously defined dists
- sh "rm -rf dists"
- }
-
- // check if an upstream artifact based on specific build number has been requested
- // This is the case of a merge build and the upstream merge build is not yet complete (it is not deemed
- // a successful build yet). The upstream job is calling this downstream job (with the its build artifiact)
- if ( params.UPSTREAM_JOB_NAME ) {
- step ([$class: 'CopyArtifact',
- projectName: "${params.UPSTREAM_JOB_NAME}",
- selector: [$class: 'SpecificBuildSelector', buildNumber: "${params.UPSTREAM_JOB_NUMBER}"]
- ])
-
- //options = get_env_from_build('build.env')
- // grab the build name/number
- //build_num = sh(returnStdout:true, script: "cat build.env | awk -F= '/BUILD_NUMBER/{print \$2}'").trim()
- build_num = ci_helper.get_env_value('build.env','BUILD_NUMBER')
- component = ci_helper.get_mdg_from_project(ci_helper.get_env_value('build.env','GERRIT_PROJECT'))
-
- // the upstream job name contains suffix with the project. Need this stripped off
- def project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
-
- // Remove the previous artifact for this component. Use the new upstream artifact
- sh "rm -rf pool/${component}"
+ containerName += "-${BUILD_NUMBER}"
+
+ server_id = null
+ http_server_name = null
+ devopstempdir = null
+ useCharmedInstaller = params.INSTALLER.equalsIgnoreCase('charmed')
+
+ try {
+ builtModules = [:]
+///////////////////////////////////////////////////////////////////////////////////////
+// Fetch stage 2 .deb artifacts
+///////////////////////////////////////////////////////////////////////////////////////
+ stage('Copy Artifacts') {
+ // cleanup any previous repo
+ sh 'rm -rf repo'
+ dir('repo') {
+ packageList = []
+ dir("${RELEASE}") {
+ RELEASE_DIR = sh(returnStdout:true, script: 'pwd').trim()
+
+ // check if an upstream artifact based on specific build number has been requested
+ // This is the case of a merge build and the upstream merge build is not yet complete
+ // (it is not deemed a successful build yet). The upstream job is calling this downstream
+ // job (with the its build artifact)
+ 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
+ project_without_branch = params.UPSTREAM_JOB_NAME.split('/')[0]
+ 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}")
+ }
+ } // lock artifactory
+ }