From 7c682ae203088b435a99863974191428202216b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 17 Jul 2024 18:26:40 +0200 Subject: [PATCH] build,tools: simplify upload of shasum signatures Use the same prompt for uploads to the web host and Cloudflare R2. --- tools/release.sh | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/tools/release.sh b/tools/release.sh index cf607b6442999d..36576a53aac075 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -138,7 +138,7 @@ sign() { echo "" while true; do - printf "Upload files to %s? [y/n] " "$webhost" + printf "Upload files to %s and Cloudflare R2? [y/n] " "$webhost" yorn="" read -r yorn @@ -147,37 +147,26 @@ sign() { fi if [ "X${yorn}" = "Xy" ]; then + # Copy SHASUMS256.txt and its signatures to the web host: # shellcheck disable=SC2086 scp ${customsshkey} "${tmpdir}/${shafile}" "${tmpdir}/${shafile}.asc" "${tmpdir}/${shafile}.sig" "${webuser}@${webhost}:${shadir}/" # shellcheck disable=SC2086,SC2029 ssh ${customsshkey} "${webuser}@${webhost}" chmod 644 "${shadir}/${shafile}.asc" "${shadir}/${shafile}.sig" - break - fi - done - while true; do - printf "Upload files from %s to R2 staging bucket? [y/n]" "$webhost" - yorn="" - read -r yorn - - if [ "X${yorn}" = "Xn" ]; then - break - fi - - if [ "X${yorn}" = "Xy" ]; then - # Note: the binaries and SHASUMS256.txt should already be in this bucket since the DO will upload them + # Copy the signatures to Cloudflare R2: + # Note: the binaries and SHASUMS256.txt should already be in the bucket + # since the promotion script should take care of uploading them. # Remove /home/dist/ part r2dir=$(echo "$shadir" | cut -c 11-) - # Copy SHASUM256.txt.asc + # Copy SHASUMS256.txt.asc # shellcheck disable=SC2086,SC2029 - ssh ${customsshkey} "$webuser@$webhost" aws s3 cp "${shadir}/${shafile}.asc" "s3://${cloudflare_bucket}/${r2dir}/${shafile}.asc" --endpoint="${cloudflare_endpoint}" --profile=${cloudflare_profile} + ssh ${customsshkey} "${webuser}@${webhost}" aws s3 cp "${shadir}/${shafile}.asc" "s3://${cloudflare_bucket}/${r2dir}/${shafile}.asc" --endpoint="${cloudflare_endpoint}" --profile=${cloudflare_profile} - # Copy SHASUM256.txt.sig + # Copy SHASUMS256.txt.sig # shellcheck disable=SC2086,SC2029 - ssh ${customsshkey} "$webuser@$webhost" aws s3 cp "${shadir}/${shafile}.sig" "s3://${cloudflare_bucket}/${r2dir}/${shafile}.sig" --endpoint="${cloudflare_endpoint}" --profile=${cloudflare_profile} - + ssh ${customsshkey} "${webuser}@${webhost}" aws s3 cp "${shadir}/${shafile}.sig" "s3://${cloudflare_bucket}/${r2dir}/${shafile}.sig" --endpoint="${cloudflare_endpoint}" --profile=${cloudflare_profile} break fi done