From 96bf9b53964957db5772d771427600931138f15a Mon Sep 17 00:00:00 2001 From: Steffen Nitschke Date: Sun, 3 Jan 2021 23:18:44 +0100 Subject: [PATCH] adjust Jenkinsfile --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 56cb9a1..d03fa62 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,13 +16,13 @@ pipeline { stage('Build') { steps { sh "./gradlew -Pversion='${REVISION}' testClasses" - } - script { - def commitId = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() - def commitDate = sh(returnStdout: true, script: 'git --no-pager show -s --format=%cd --date=short HEAD').trim() + script { + def commitId = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() + def commitDate = sh(returnStdout: true, script: 'git --no-pager show -s --format=%cd --date=short HEAD').trim() - REVISION = "${env.BRANCH_NAME}-${commitDate}.${commitId}" + REVISION = "${env.BRANCH_NAME}-${commitDate}.${commitId}" + } } }