Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save firstTime this build was attempted in past-jobs.json #100

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Jenkinsfile.trigger
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ node {
! wget --timeout=5 -qO past-jobs.json "$JOB_URL/lastSuccessfulBuild/artifact/past-jobs.json" \\
|| ! jq 'empty' past-jobs.json \\
; then
# temporary migration of old data
if ! wget --timeout=5 -qO past-jobs.json "$JOB_URL/lastSuccessfulBuild/artifact/pastFailedJobs.json" || ! jq 'empty' past-jobs.json; then
echo '{}' > past-jobs.json
fi
echo '{}' > past-jobs.json
fi
jq -c -L.scripts --slurpfile pastJobs past-jobs.json '
include "jenkins";
Expand Down Expand Up @@ -210,8 +207,10 @@ node {
set -Eeuo pipefail -x

jq <<<"$currentJobsJson" '
# save firstTime if it is not set yet
map_values(.firstTime //= .lastTime)
# merge the two objects recursively, preferring data from "buildCompletionDataJson"
. * ( env.buildCompletionDataJson | fromjson )
| . * ( env.buildCompletionDataJson | fromjson )
' | tee past-jobs.json
'''
archiveArtifacts(
Expand Down
Loading