From 497d9ac139ee856713d76ecc5366aff05c2212a7 Mon Sep 17 00:00:00 2001 From: ahmed531998 Date: Wed, 30 Aug 2023 11:58:53 +0200 Subject: [PATCH] version_number --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1df92e6..67b2bad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,9 +18,9 @@ pipeline { stage('Building image') { steps{ script { - version_info= $(git rev-parse --short HEAD) + version_info= sh(script: 'git rev-parse --short HEAD', returnStdout: true) sh(script: 'echo "${version_info}"') - sh(script: 'echo "git rev-parse --short HEAD"') + sh(script: 'echo "${GIT_COMMIT}"') dockerImage = docker.build(imagename, '--build-arg version_info=${version_info} .') } }