mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #30551 from david-mcmahon/job-cache
Automatic merge from submit-queue Construct a valid json file for the job cache.
This commit is contained in:
commit
a953eb42b1
@ -151,15 +151,24 @@ function update_job_result_cache() {
|
||||
|
||||
mkdir -p ${tmp_results%/*}
|
||||
|
||||
# Construct a valid json file
|
||||
echo "[" > ${tmp_results}
|
||||
|
||||
for upload_attempt in $(seq 3); do
|
||||
echo "Copying ${job_results} to ${tmp_results} (attempt ${upload_attempt})"
|
||||
gsutil -q cp ${job_results} ${tmp_results} 2>&- || continue
|
||||
gsutil -q cat ${job_results} 2>&- |\
|
||||
sed -n 's/^\({"version".*}\),*/\1,/p' >> ${tmp_results} || continue
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
echo "{\"version\": \"${version}\", \"buildnumber\": \"${BUILD_NUMBER}\"," \
|
||||
"\"result\": \"${build_result}\"}" >> ${tmp_results}
|
||||
|
||||
# JSON doesn't like terminating elements to contain a "," separator, so
|
||||
# terminate the elements with an empty one.
|
||||
echo -e "{}\n]" >> ${tmp_results}
|
||||
|
||||
for upload_attempt in $(seq 3); do
|
||||
echo "Copying ${tmp_results} to ${job_results} (attempt ${upload_attempt})"
|
||||
gsutil -q -h "Content-Type:application/json" cp -a "${gcs_acl}" \
|
||||
|
Loading…
Reference in New Issue
Block a user