jenkins: changed nightly built image to test release

The version string of a nightly build (not a release build) is
adapted to a test release including the build number of the
top job, e.g.
    previously: 1.1.3-5-gca0e0ff-dirty
    now:        1.1.3.Test127-5-gca0e0ff-dirty

BugzID: 69736

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-01-14 10:52:25 +01:00
parent 7c4c903f2a
commit 6b0bd6ef95
1 changed files with 20 additions and 1 deletions

21
Jenkinsfile vendored
View File

@ -128,6 +128,11 @@ def build_version(versionParam) {
String newVersionStr = versionParam
versionArr[0] = newVersionStr
}
else {
def buildnbr = getTopUpstreamBuildNumber()
String nightlyPart = versionArr[0] + ".Test${buildnbr}"
versionArr[0] = nightlyPart
}
rlsVersion = versionArr.join("-")
return rlsVersion
}
@ -226,4 +231,18 @@ def archive(image_type_in, single_fitImage) {
}
}
def getTopUpstreamBuildNumber() {
// Iterating though all upstream jobs:
// currentBuild.upstreamBuilds.each { item ->
// echo "upstream build: ${item}"
// def nbr = item.getNumber()
// echo "nbr=${nbr}"
// }
def upstreamJobList = currentBuild.upstreamBuilds
def nbrOfUpstreamJobs = upstreamJobList.size()
def topJob = upstreamJobList[nbrOfUpstreamJobs-1]
println "Top upstream project: " + topJob.getFullDisplayName()
def topJobNbr = topJob.getNumber()
println "Top upstream job build Number = ${topJobNbr}"
return topJobNbr
}