GHA: Aggregate sites for release also uploaded to Akamai

This commit is contained in:
aboyko
2023-11-14 12:28:58 -05:00
parent 7b4d94b51a
commit dca3c93a79
2 changed files with 36 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ jobs:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
run: |
echo "Old S3 Aggregate Update Sites Creation..."
dirs=`aws s3 ls s3://dist.springsource.com/release/TOOLS/sts4/update/${{ inputs.version }}/`
pattern='^e[0-9]+.[0-9]+/$'
for dir in $dirs
@@ -61,4 +62,28 @@ jobs:
aws s3 mv ./p2.index s3://dist.springsource.com/release/TOOLS/sts4/update/${dir} --acl public-read
${{ github.workspace }}/.github/scripts/clear-s3-caches.sh release/TOOLS/sts4/update/${dir_name}
fi
done
done
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]+/$'
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}"
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url
cat ./compositeArtifacts.xml
cat ./compositeContent.xml
if [[ ${dir_name} == ${{ inputs.latest }} ]]; then
aws s3 cp ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/
aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/latest/
aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/latest/
echo "TODO: Purge Cache"
fi
aws s3 mv ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
aws s3 mv ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
aws s3 mv ./p2.index s3://tools-spring-io/release/TOOLS/sts4/update/${dir}
echo "TODO: Purge Cache"
fi
done

View File

@@ -35,6 +35,7 @@ jobs:
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }}
run: |
echo "Old S3 Aggregate Update Sites Creation..."
site_url="https://download.springsource.com/release/TOOLS/sts4-language-server-integrations/${{ inputs.version }}"
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url
cat ./compositeArtifacts.xml
@@ -43,3 +44,12 @@ jobs:
aws s3 cp ./compositeContent.xml s3://dist.springsource.com/release/TOOLS/sts4-language-server-integrations/ --acl public-read
aws s3 cp ./p2.index s3://dist.springsource.com/release/TOOLS/sts4-language-server-integrations/ --acl public-read
${{ github.workspace }}/.github/scripts/clear-s3-caches.sh release/TOOLS/sts4-language-server-integrations
echo "Akamai S3 Aggregate Update Sites Creation..."
site_url="https://cdn.spring.io/spring-tools/release/TOOLS/sts4-language-server-integrations/${{ inputs.version }}"
${{ github.workspace }}/.github/scripts/generate-composite-site-files.sh ${{ steps.timestamp.outputs.date }} $site_url
cat ./compositeArtifacts.xml
cat ./compositeContent.xml
aws s3 cp ./compositeArtifacts.xml s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
echo "TODO: purge cache!"