[web] upload to CDN buckets concurrently (#23494)

* [web] upload to CDN buckets concurrently

* [web] documentation for detaching, recording of pid and waiting

GitOrigin-RevId: abdb357771d9c5e34330827b146ae43eb6146675
This commit is contained in:
Jakob Ackermann
2025-02-11 09:33:45 +00:00
committed by Copybot
parent 14cb64df6b
commit 0f57110de0

View File

@@ -55,10 +55,17 @@ if [[ "$BRANCH_NAME" == "main" ]] || [[ "$BRANCH_NAME" == "staging-main" ]]; the
bin/compress_assets
upload_into_bucket "$CDN_STAG" &&
verify_upload_into_bucket "$CDN_STAG" || exit 3
verify_upload_into_bucket "$CDN_STAG" || exit 3 &
pid_staging=$! # record pid of the detached process "upload && verify || exit 3")
pid_production=
# Only upload to production CDN if branch is
if [[ "$BRANCH_NAME" == "main" ]]; then
upload_into_bucket "$CDN_PROD" &&
verify_upload_into_bucket "$CDN_PROD" || exit 3
verify_upload_into_bucket "$CDN_PROD" || exit 4 &
pid_production=$! # record pid of the detached process "upload && verify || exit 4")
fi
wait "$pid_staging" # wait for staging upload to finish, wait(1) will exit if the upload failed
wait "$pid_production" # wait for production upload to finish (if started), wait(1) will exit if the upload failed
fi