ci: Set file mtimes from git log
infra/kickstart/pipeline/head This commit looks good Details

Every time the job runs, the _Publish_ stage changes the timestamps of
the files on the server, even if their contents haven't changed.  This
is because each build runs from a fresh checkout, so every file appears
to have just been created.  To avoid this, and leave files on the server
alone unless they've changed, we now set the modification timestamp of
every file from its last commit.
master
Dustin 2025-07-09 10:35:41 -05:00
parent ed5a4f9743
commit f07abaff3a
3 changed files with 10 additions and 0 deletions

View File

@ -3,5 +3,6 @@
- *.j2
- .gitignore
- Makefile
- fixtimes.sh
- publish.sh
- render.py

1
ci/Jenkinsfile vendored
View File

@ -10,6 +10,7 @@ pipeline {
stages {
stage('Build') {
steps {
sh './fixtimes.sh'
sh 'make'
}
}

8
fixtimes.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
git ls-files | while IFS= read -r file; do
ts=$(git log -1 --format=%at -- "${file}")
if [ -n "${ts}" ]; then
touch -d "@${ts}" -- "${file}"
fi
done