Skip to content

Aggregate Distro Update Sites #9

Aggregate Distro Update Sites

Aggregate Distro Update Sites #9

name: Aggregate Distro Update Sites
on:
workflow_dispatch:
inputs:
version:
description: Version suffix in S3 (i.e. 4.19.1.RELEASE)
required: true
type: string
latest:
description: Latest eclipse release version (i.e. e4.28)
required: true
type: string
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:
sparse-checkout: |
.github
- name: Timestamp
id: timestamp
run: echo "date=`echo $(($(date +%s%N) / 1000000))`" >> $GITHUB_OUTPUT
- name: Cloudgate S3 Configuration
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
with:
aws-access-key-id: ${{ secrets.TOOLS_CLOUDGATE_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TOOLS_CLOUDGATE_SECRET_KEY }}
role-to-assume: arn:aws:iam::${{ secrets.TOOLS_CLOUDGATE_ACCOUNT_ID }}:role/${{ secrets.TOOLS_CLOUDGATE_USER }}
role-session-name: ${{ github.run_id }}
aws-region: us-east-1
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 }}
run: |
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
echo "Found ${dir}"
dir_name=${dir:0:-1}
site_url="https://cdn.spring.io/spring-tools/release/TOOLS/sts4/update/${{ inputs.version }}/${dir_name}"
if [[ ${dir_name} == "e4.32" ]]; then
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url true
else
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url
fi
cat ./compositeArtifacts.xml
cat ./compositeContent.xml
fi
done
purge_cache:
needs: [ update-aggregate-update-sites ]
runs-on: [self-hosted]
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 }}