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}" + } } }