Skip to content

Commit 72e2f8f

Browse files
authored
Merge pull request #100 from infosiftr/firstTime
Save firstTime this build was attempted in past-jobs.json
2 parents 5978683 + 736d30f commit 72e2f8f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Jenkinsfile.trigger

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ node {
5252
! wget --timeout=5 -qO past-jobs.json "$JOB_URL/lastSuccessfulBuild/artifact/past-jobs.json" \\
5353
|| ! jq 'empty' past-jobs.json \\
5454
; then
55-
# temporary migration of old data
56-
if ! wget --timeout=5 -qO past-jobs.json "$JOB_URL/lastSuccessfulBuild/artifact/pastFailedJobs.json" || ! jq 'empty' past-jobs.json; then
57-
echo '{}' > past-jobs.json
58-
fi
55+
echo '{}' > past-jobs.json
5956
fi
6057
jq -c -L.scripts --slurpfile pastJobs past-jobs.json '
6158
include "jenkins";
@@ -210,8 +207,10 @@ node {
210207
set -Eeuo pipefail -x
211208

212209
jq <<<"$currentJobsJson" '
210+
# save firstTime if it is not set yet
211+
map_values(.firstTime //= .lastTime)
213212
# merge the two objects recursively, preferring data from "buildCompletionDataJson"
214-
. * ( env.buildCompletionDataJson | fromjson )
213+
| . * ( env.buildCompletionDataJson | fromjson )
215214
' | tee past-jobs.json
216215
'''
217216
archiveArtifacts(

0 commit comments

Comments
 (0)