3 def values = project.split('/')
4 if ( values.size() > 1 ) {
7 // no prefix, likely just the project name then
11 def project_checkout() {
12 // checkout the project
13 git url: "https://osm.etsi.org/gerrit/${env.GERRIT_PROJECT}"
15 sh "git fetch origin ${env.GERRIT_REFSPEC}"
16 if (env.GERRIT_PATCHSET_REVISION.size() > 0 ) {
17 sh "git checkout -f ${env.GERRIT_PATCHSET_REVISION}"
21 def devops_checkout() {
23 git url: 'https://osm.etsi.org/gerrit/osm/devops'
28 mdg = Get_MDG("${env.GERRIT_PROJECT}")
29 println("MDG is ${mdg}")
31 if ( env.GERRIT_EVENT_TYPE.equals('change-merged') ) {
32 def downstream_params = [
33 string(name: 'GERRIT_BRANCH', value: env.GERRIT_BRANCH),
34 string(name: 'GERRIT_PROJECT', value: env.GERRIT_PROJECT),
35 string(name: 'GERRIT_REFSPEC', value: env.GERRIT_REFSPEC),
36 string(name: 'GERRIT_PATCHSET_REVISION', value: env.GERRIT_PATCHSET_REVISION),
38 result = build job: "${mdg}/${env.GERRIT_BRANCH}", parameters: downstream_params, propagate: true
39 if (result.getResult() != 'SUCCESS') {
40 project = result.getProjectName()
41 build = result.getNumber()
42 error("${project} build ${build} failed")
55 container_name = "${env.GERRIT_PROJECT}-${env.GERRIT_BRANCH}"
58 stage('Docker-Build') {
59 sh "docker build -t ${container_name} ."
62 withDockerContainer("${container_name}") {
63 stage('Docker-Setup') {
65 groupadd -o -g $(id -g) -r jenkins
66 useradd -o -u $(id -u) --create-home -r -g jenkins jenkins
70 sh 'devops-stages/stage-test.sh'
73 sh 'devops-stages/stage-build.sh'
76 sh 'devops-stages/stage-archive.sh'
77 archiveArtifacts artifacts: "dists/**,pool/${mdg}/*.deb", fingerprint: true