GHA: Test gen downloads page on Akamai

This commit is contained in:
aboyko
2023-11-09 22:44:47 -05:00
parent 1271beb5e1
commit 68deafa83c

View File

@@ -21,22 +21,23 @@ jobs:
- name: Update Nightly Distro Downloads page
run: |
dist_path="snapshot/STS4/nightly/dist/e4.28"
s3_url=s3://dist.springsource.com/${dist_path}
s3_url=s3://tools-spring-io/${dist_path}/
downloads_html="sts4-nightly-e4.28.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`
echo '<ul>' >> $downloads_html
for file in $files
do
if [[ "$file" =~ ^"s3://dist." ]]; then
download_url=https://download${file:9}
echo "entry: ${file}"
if [[ "$file" =~ ^"s3://spring-tools-io" ]]; then
download_url=https://cdn.spring.io/spring-tools${file:20}
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://dist.springsource.com/snapshot/STS4/ --acl public-read
aws s3 ls s3://dist.springsource.com/snapshot/STS4/
aws s3 mv ./$downloads_html s3://tools-spring-io/snapshot/STS4/ dryrun
aws s3 ls s3://tools-spring-io/dist_path/