jenkins: creating revision files and archive them
BugzID: 69785 Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
parent
af20c2fa2e
commit
5359b74d30
|
|
@ -24,6 +24,8 @@ pipeline {
|
|||
buildhistory = "${SHARED_BUILD}/buildhistory"
|
||||
|
||||
DISTO_VERSION_FILE = "${SHARED_BUILD}/conf/distro_version.inc"
|
||||
SUBMODULE_VERION_FILE = "${WORKSPACE}/submodule_revisions"
|
||||
AUTOREV_VERSION_FILE = "${WORKSPACE}/autorev_revisions.inc"
|
||||
}
|
||||
|
||||
options {
|
||||
|
|
@ -72,6 +74,20 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage('collect versions') {
|
||||
steps {
|
||||
script {
|
||||
revisions = getAutoRevHashes()
|
||||
writeFile(file: "${env.AUTOREV_VERSION_FILE}", text: "${revisions}")
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts(artifacts: "${env.SUBMODULE_VERION_FILE},${env.AUTOREV_VERSION_FILE},${env.DISTO_VERSION_FILE}", onlyIfSuccessful: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('build') {
|
||||
steps {
|
||||
script {
|
||||
|
|
@ -104,6 +120,7 @@ def handle_submodules(versionParam) {
|
|||
}
|
||||
submoduleStatus = sh(returnStdout: true, script: "git submodule status").trim() // print submodule hashes to jenkins log
|
||||
println "${submoduleStatus}"
|
||||
writeFile(file: "${env.SUBMODULE_VERION_FILE}", text: "${submoduleStatus}")
|
||||
}
|
||||
|
||||
def build_version(versionParam) {
|
||||
|
|
@ -245,3 +262,9 @@ def getTopUpstreamBuildNumber() {
|
|||
println "Top upstream job build Number = ${topJobNbr}"
|
||||
return topJobNbr
|
||||
}
|
||||
|
||||
def getAutoRevHashes() {
|
||||
sh(script: "bash -c '. ./env.image-ostree && bitbake netmodule-linux-image-dev --runall=fetch'")
|
||||
def revs = sh(returnStdout: true, script: "bash -c \". ./env.image-ostree && clear && buildhistory-collect-srcrevs | sort | uniq | grep -v \"#\"\"").trim()
|
||||
return revs
|
||||
}
|
||||
Loading…
Reference in New Issue