Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build,tools: simplify upload of shasum signatures #53892

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading