From a19826ea492d6045a1449b610a1f95e426d0fa12 Mon Sep 17 00:00:00 2001 From: primakov Date: Thu, 11 Apr 2024 12:50:46 +0300 Subject: [PATCH] fix no branch name in scope --- install/ci/Jenkinsfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install/ci/Jenkinsfile b/install/ci/Jenkinsfile index 6841b9d..d960bfa 100644 --- a/install/ci/Jenkinsfile +++ b/install/ci/Jenkinsfile @@ -1,11 +1,13 @@ stage('install:ci') { - def tag = sh(returnStdout: true, script: "git tag --contains").trim() + def tag = sh(returnStdout: true, script: "git tag --contains").trim() + def branchName = sh(returnStdout: true, script: "git rev-parse --abbrev-ref HEAD").trim() + def lastLog = sh(returnStdout: true, script: "git log -1").trim() if (tag) { - currentBuild.displayName = "#${BUILD_NUMBER}, tag${tag}" + currentBuild.displayName = "#${BUILD_NUMBER}, tag ${tag}" } else { - currentBuild.displayName = "#${BUILD_NUMBER}, branch ${BRANCH}" + currentBuild.displayName = "#${BUILD_NUMBER}, branch ${branchName}" } - currentBuild.description = "#${BUILD_NUMBER}, branch ${BRANCH}, tag${tag}" + currentBuild.description = "#${BUILD_NUMBER}, branch ${branchName}, tag ${tag}\n${lastLog}" echo 'starting installing' sh 'npm ci' } \ No newline at end of file