version_number

This commit is contained in:
ahmed531998 2023-08-30 11:54:01 +02:00
parent ef22a1c300
commit cb737a466a
1 changed files with 3 additions and 3 deletions

6
Jenkinsfile vendored
View File

@ -13,14 +13,14 @@ pipeline {
stage('Cloning Git') {
steps {
git([url: git_url, branch: 'main', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346'])
script{
version_info= sh(script: 'git rev-parse --short HEAD', returnStdout: true)
}
}
}
stage('Building image') {
steps{
script {
version_info= sh(script: 'git rev-parse --short HEAD', returnStdout: true)
sh(script: 'echo "${version_info}"')
sh(script: 'echo "git rev-parse --short HEAD"')
dockerImage = docker.build(imagename, '--build-arg version_info=${version_info} .')
}
}