From 918700c5a56038529ac28ddfb86da96191f33604 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 20 Jun 2020 23:08:56 +0200 Subject: Jenkins: lib: record Git commit ID in job description --- vars/buildPackage.groovy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vars') diff --git a/vars/buildPackage.groovy b/vars/buildPackage.groovy index f2a72dc4..801a2b33 100644 --- a/vars/buildPackage.groovy +++ b/vars/buildPackage.groovy @@ -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', -- cgit v1.2.3