Fix .git folder timestamps using 'git restore-mtime'

This commit is contained in:
Ben 2023-01-28 10:08:56 +01:00
parent 8fc32c49ad
commit b116c19c9e

9
Jenkinsfile vendored

@ -1,6 +1,12 @@
def amd_image def amd_image
def arm_image def arm_image
def intel_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 { pipeline {
@ -18,6 +24,7 @@ pipeline {
steps { steps {
script { script {
DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64" DOCKER_GIT_TAG_AMD="$DOCKER_GIT_TAG" + "_amd64"
restoreMTime()
amd_image = docker.build("$DOCKER_GIT_TAG_AMD") amd_image = docker.build("$DOCKER_GIT_TAG_AMD")
} }
} }
@ -27,6 +34,7 @@ pipeline {
steps { steps {
script { script {
DOCKER_GIT_TAG_ARM="$DOCKER_GIT_TAG" + "_arm64" DOCKER_GIT_TAG_ARM="$DOCKER_GIT_TAG" + "_arm64"
restoreMTime()
arm_image = docker.build("$DOCKER_GIT_TAG_ARM") arm_image = docker.build("$DOCKER_GIT_TAG_ARM")
} }
} }
@ -36,6 +44,7 @@ pipeline {
steps { steps {
script { script {
DOCKER_GIT_TAG_INTEL="$DOCKER_GIT_TAG" + "_intel_sky_lake" DOCKER_GIT_TAG_INTEL="$DOCKER_GIT_TAG" + "_intel_sky_lake"
restoreMTime()
intel_image = docker.build("$DOCKER_GIT_TAG_INTEL") intel_image = docker.build("$DOCKER_GIT_TAG_INTEL")
} }
} }