GHA: Switch p2 urls in poms to cdn.spring.io/spring-tools

This commit is contained in:
aboyko
2023-11-17 13:31:09 -05:00
parent d173af8b7a
commit ca93ab086d
11 changed files with 55 additions and 14 deletions

View File

@@ -16,6 +16,8 @@ jobs:
update-aggregate-update-sites:
runs-on: ubuntu-latest
outputs:
invalid_urls: ${{ steps.gen-aggregate-sites.outputs.invalid_urls }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
@@ -35,6 +37,7 @@ jobs:
role-duration-seconds: 900
role-skip-session-tagging: true
- name: Generate and Upload Aggregate Update Sites Data
id: gen-aggregate-sites
env:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
@@ -66,6 +69,7 @@ jobs:
echo "Akamai S3 Aggregate Update Sites Creation..."
dirs=`aws s3 ls s3://tools-spring-io/release/TOOLS/sts4/update/${{ inputs.version }}/`
pattern='^e[0-9]+.[0-9]+/$'
invalid_urls=""
for dir in $dirs
do
if [[ "$dir" =~ $pattern ]]; then
@@ -77,13 +81,31 @@ jobs:
cat ./compositeContent.xml
if [[ ${dir_name} == ${{ inputs.latest }} ]]; then
aws s3 cp ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/latest/compositeArtifacts.xml "
aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/latest/compositeContent.xml "
aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/latest/
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/latest/p2.index "
echo "TODO: Purge Cache"
fi
aws s3 mv ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/${dir}/compositeArtifacts.xml "
aws s3 mv ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/${dir}/compositeContent.xml "
aws s3 mv ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
echo "TODO: Purge Cache"
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4/update/${dir}/p2.index "
fi
done
echo "invalid_urls=$invalid_urls" >> $GITHUB_OUTPUT
purge_cache:
needs: [ update-aggregate-update-sites ]
runs-on: [self-hosted, macOS]
steps:
- uses: ./.github/actions/akamai-purge-osx
name: Invalidate URLs
env:
EDGERC: ${{ secrets.EDGERC }}
with:
command: invalidate
urls: ${{ needs.update-aggregate-update-sites.outputs.invalid_urls }}