From 158411564b258fe7efda60f2638cde34093cc7e4 Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Mon, 27 Apr 2020 16:38:32 +0200 Subject: [PATCH] Set piper exe version when under test (#1462) Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com> --- src/com/sap/piper/PiperGoUtils.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/sap/piper/PiperGoUtils.groovy b/src/com/sap/piper/PiperGoUtils.groovy index 23c6edce0..f253e2949 100644 --- a/src/com/sap/piper/PiperGoUtils.groovy +++ b/src/com/sap/piper/PiperGoUtils.groovy @@ -28,7 +28,7 @@ class PiperGoUtils implements Serializable { steps.sh 'wget https://github.com/$REPOSITORY_UNDER_TEST/archive/$LIBRARY_VERSION_UNDER_TEST.tar.gz' steps.sh 'tar xzf $LIBRARY_VERSION_UNDER_TEST.tar.gz' steps.dir("jenkins-library-${steps.env.LIBRARY_VERSION_UNDER_TEST}") { - steps.sh 'CGO_ENABLED=0 go build -tags release -o ../piper . && chmod +x ../piper && chown 1000:999 ../piper' + steps.sh "CGO_ENABLED=0 go build -tags release -ldflags \"-X github.com/SAP/jenkins-library/cmd.GitCommit=${steps.env.LIBRARY_VERSION_UNDER_TEST}\" -o ../piper . && chmod +x ../piper && chown 1000:999 ../piper" } steps.sh 'rm -rf $LIBRARY_VERSION_UNDER_TEST.tar.gz jenkins-library-$LIBRARY_VERSION_UNDER_TEST' }