From b116c19c9ed888981de63c7b1b0a1304ea7abfcc Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 28 Jan 2023 10:08:56 +0100 Subject: [PATCH] Fix .git folder timestamps using 'git restore-mtime' --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index eb0f5bd5..0a7e4a4d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,12 @@ def amd_image def arm_image def intel_image +def restoreMTime() { + sh ''' + git restore-mtime + touch -t $(git show -s --date=format:'%Y%m%d%H%M.%S' --format=%cd HEAD) .git + ''' +} pipeline { @@ -18,6 +24,7 @@ pipeline { steps { script { DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64" + restoreMTime() amd_image = docker.build("$DOCKER_GIT_TAG_AMD") } } @@ -27,6 +34,7 @@ pipeline { steps { script { DOCKER_GIT_TAG_ARM="$DOCKER_GIT_TAG" + "_arm64" + restoreMTime() arm_image = docker.build("$DOCKER_GIT_TAG_ARM") } } @@ -36,6 +44,7 @@ pipeline { steps { script { DOCKER_GIT_TAG_INTEL="$DOCKER_GIT_TAG" + "_intel_sky_lake" + restoreMTime() intel_image = docker.build("$DOCKER_GIT_TAG_INTEL") } }