[GHA] Use new R2 bucket to store build artifacts

[GHA] Final changes
This commit is contained in:
aboyko
2024-07-04 16:36:43 -04:00
parent 6f779c510f
commit 5144d97b1c
14 changed files with 234 additions and 253 deletions

View File

@@ -3,21 +3,24 @@ set -e
dist_path=$1
eclipse_version=$2
build_type=$3
s3_bucket=$4
download_url_root=$5
# Akamai tools-spring-io bucket
s3_url=s3://tools-spring-io/${dist_path}
s3_url=s3://${s3_bucket}/${dist_path}
downloads_html="sts4-nightly-${eclipse_version}.html"
files=`aws s3 cp ${s3_url} . --recursive --exclude "*" --include "spring-tool-suite-4*.zip" --include "spring-tool-suite-4*.dmg" --include "spring-tool-suite-4*.self-extracting.jar" --include "spring-tool-suite-4*.tar.gz" --exclude "*/*" --dryrun`
rm -f ./${downloads_html}
echo '<ul>' >> $downloads_html
s3_url_prefix="s3://${AWS_S3_BUCKET}"
s3_url_prefix_length=${#s3_url_prefix}
for file in $files
do
if [[ "$file" =~ ^"s3://tools-spring-io" ]]; then
download_url=https://cdn.spring.io/spring-tools${file:20} #
if [[ "$file" =~ ^"${s3_url_prefix}" ]]; then
download_url=${download_url_root}${file:$s3_url_prefix_length} #
filename=${file:${#s3_url}+1}
echo ' <li><a href="'${download_url}'">'${filename}'</li>' >> $downloads_html
fi
done
echo '</ul>' >> $downloads_html
cat ./$downloads_html
aws s3 mv ./$downloads_html s3://tools-spring-io/${build_type}/STS4/ --no-progress
aws s3 mv ./$downloads_html s3://${s3_bucket}/${build_type}/STS4/ --no-progress