Jenkins: lib: record Git commit ID in job description

This commit is contained in:
Christian Poessinger 2020-06-20 23:08:56 +02:00
parent 22888ab751
commit 918700c5a5

View File

@ -75,6 +75,10 @@ def call(description, pkgList) {
steps {
script {
checkout scm
def commitId = sh(returnStdout: true, script: 'git rev-parse --short=11 HEAD').trim()
currentBuild.description = sprintf('Git SHA1: %s', commitId[-11..-1])
pkgList.each { pkg ->
dir(pkg.name) {
checkout([$class: 'GitSCM',