* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
// checkout the project
// this is done automaticaly by the multibranch pipeline plugin
// git url: "${url_prefix}/${project}"
// checkout the project
// this is done automaticaly by the multibranch pipeline plugin
// git url: "${url_prefix}/${project}"
sh "git fetch origin ${refspec}"
if (GERRIT_PATCHSET_REVISION.size() > 0 ) {
sh "git checkout -f ${revision}"
}
}
sh "git fetch origin ${refspec}"
if (GERRIT_PATCHSET_REVISION.size() > 0 ) {
sh "git checkout -f ${revision}"
}
}
-def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,build_system) {
- println("build_system = ${build_system}")
+def ci_pipeline(mdg,url_prefix,project,branch,refspec,revision,do_stage_3,artifactory_server,docker_args="",do_stage_4=false) {
+ println("do_stage_3= ${do_stage_3}")
- sh "echo 'RUN groupadd -o -g " + "id -g".execute().text + " -r jenkins \\' >> Dockerfile"
- sh "echo ' && useradd -o -u " + "id -u".execute().text + " --create-home -r -g jenkins jenkins' >> Dockerfile"
+ sh '''
+ echo RUN groupadd -o -g $(id -g) -r jenkins >> Dockerfile
+ echo RUN useradd -o -u $(id -u) --create-home -r -g jenkins jenkins >> Dockerfile
+ '''
+ stage('Archive') {
+ sh "mkdir -p changelog"
+ sh "devops/tools/generatechangelog-pipeline.sh > changelog/changelog-${mdg}.html"
+ sh(returnStdout:true, script: 'devops-stages/stage-archive.sh').trim()
+ ci_helper.archive(artifactory_server,mdg,branch,'untested')
+ }
stage('Build System') {
def downstream_params_stage_3 = [
string(name: 'GERRIT_BRANCH', value: "${branch}"),
string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}" ),
string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}" ),
stage('Build System') {
def downstream_params_stage_3 = [
string(name: 'GERRIT_BRANCH', value: "${branch}"),
string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}" ),
string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}" ),
- // callout to stage_3. This is the system build
- result = build job: "osm-stage_3/${branch}", parameters: downstream_params_stage_3, propagate: true
+ // callout to stage_3. This is the system build
+ result = build job: "${stage_3_job}/${branch}", parameters: downstream_params_stage_3, propagate: true
if (result.getResult() != 'SUCCESS') {
project = result.getProjectName()
build = result.getNumber()
if (result.getResult() != 'SUCCESS') {
project = result.getProjectName()
build = result.getNumber()