Skip to content

Commit

Permalink
Merge pull request #100 from infosiftr/firstTime
Browse files Browse the repository at this point in the history
Save firstTime this build was attempted in past-jobs.json
  • Loading branch information
tianon authored Dec 10, 2024
2 parents 5978683 + 736d30f commit 72e2f8f
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit 72e2f8f

Please sign in to comment.