From 51f394f82d58d521c533d0dac85c6aa1d9e916fb Mon Sep 17 00:00:00 2001 From: Michele Scuttari Date: Fri, 17 Jan 2025 19:44:13 +0100 Subject: [PATCH] Use git hash for package image --- .jenkins/package-debian-12.Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.jenkins/package-debian-12.Jenkinsfile b/.jenkins/package-debian-12.Jenkinsfile index 5755832da..a0153ed54 100644 --- a/.jenkins/package-debian-12.Jenkinsfile +++ b/.jenkins/package-debian-12.Jenkinsfile @@ -21,7 +21,8 @@ node { stage("Checkout") { dir(marcoSrcPath) { - checkout(scm) + def scmVars = checkout(scm) + env.GIT_COMMIT = scmVars.GIT_COMMIT } } @@ -41,7 +42,7 @@ node { def dockerImage stage('Docker image') { - dockerImage = docker.build(dockerMARCOImageName + ':latest', dockerArgs) + dockerImage = docker.build(dockerMARCOImageName + ":" + env.GIT_COMMIT[0..6], dockerArgs) } dockerImage.inside() {