From 0caec5b6580ef9ada8598beb511c675bc6ea4154 Mon Sep 17 00:00:00 2001 From: aboyko Date: Mon, 31 Jul 2023 19:00:59 -0400 Subject: [PATCH] [GHA-Build] Placeholders for clearing S3 caches in the builds --- .github/scripts/clear-s3-caches.sh | 4 ++- .../workflows/eclipse-ls-extensions-build.yml | 4 ++- .../gh-hosted-eclipse-distro-build.yml | 29 +++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/scripts/clear-s3-caches.sh b/.github/scripts/clear-s3-caches.sh index 761c2f804..977f2acfd 100755 --- a/.github/scripts/clear-s3-caches.sh +++ b/.github/scripts/clear-s3-caches.sh @@ -1,6 +1,8 @@ set -e s3_path=$1 + +#Flush AWS Cloudfront Cache #invalidation_json=`aws cloudfront create-invalidation --distribution-id ECAO9Q8651L8M --output json --paths "/${s3_path}/*"` #echo "Invalidation response: ${invalidation_json}" #invalidation_id=`echo $invalidation_json | jq -r '.Invalidation.Id'` @@ -14,7 +16,7 @@ s3_path=$1 #done #echo "Final invalidation status: ${invalidation_status}" -# Flush CloudFlare cache +# Flush CloudFlare Cache s3_url=s3://dist.springsource.com/${s3_path} files=`aws s3 cp ${s3_url} . --recursive --include "*" --dryrun` counter=0 diff --git a/.github/workflows/eclipse-ls-extensions-build.yml b/.github/workflows/eclipse-ls-extensions-build.yml index e04d370af..3d8400530 100644 --- a/.github/workflows/eclipse-ls-extensions-build.yml +++ b/.github/workflows/eclipse-ls-extensions-build.yml @@ -39,6 +39,7 @@ jobs: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: sparse-checkout: | + .github headless-services eclipse-language-servers - name: Set up JDK 17 @@ -78,7 +79,7 @@ jobs: else ./mvnw --batch-mode clean deploy -P${{ inputs.eclipse_profile }} -P${{ inputs.build_type }} $sts4_ls_version_param -Pgitactions -Pgpg.sign -Dmaven.test.skip=true -Dsigning.skip=true -Dhttpclient.retry-max=20 -Declipse.p2.mirrors=false -Ds3service.https-only=true -Dtycho.localArtifacts=ignore fi - - name: + - name: Clear S3 Caches if: ${{ inputs.build_type != 'snapshot' }} env: AWS_ACCESS_KEY_ID: ${{ secrets.TOOLS_S3_ACCESS_KEY }} @@ -90,6 +91,7 @@ jobs: dist_path=`cat ${{ github.workspace }}/eclipse-language-servers/org.springframework.tooling.ls.integration.repository/target/s3-p2-repo-dist-path.txt` echo $dist_path - name: Verify Eclipse LS Extensions on e429 + if: ${{ inputs.build_type == 'snapshot' }} run: | cd eclipse-language-servers if command -v xvfb-run ; then diff --git a/.github/workflows/gh-hosted-eclipse-distro-build.yml b/.github/workflows/gh-hosted-eclipse-distro-build.yml index c533efffc..18a83e06d 100644 --- a/.github/workflows/gh-hosted-eclipse-distro-build.yml +++ b/.github/workflows/gh-hosted-eclipse-distro-build.yml @@ -90,6 +90,17 @@ jobs: aws s3 rm s3://dist.springsource.com/${dist_path} --recursive --exclude "*" --include "spring-tool-suite-4*linux*.tar.gz*" --exclude "*/*" echo "Uploading new Linux .ta.gz files to s3..." aws s3 cp . s3://dist.springsource.com/${dist_path} --recursive --exclude "*" --include "spring-tool-suite-4*linux*.tar.gz*" --exclude "*/*" --acl public-read --no-progress + - name: Clear S3 Caches for P2 Repo + if: ${{ inputs.build_type != 'snapshot' }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.TOOLS_S3_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.TOOLS_S3_SECRET_KEY }} + AWS_DEFAULT_REGION: us-east-1 + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} + run: | + dist_path=`cat ${{ github.workspace }}/eclipse-distribution/org.springframework.boot.ide.product.${{ inputs.eclipse_profile }}/target/s3-p2-repo-dist-path.txt` + echo $dist_path - name: Update Nightly Distro Downloads page if: ${{ inputs.build_type == 'snapshot' && always() }} env: @@ -280,6 +291,24 @@ jobs: if: ${{ always() }} runs-on: ubuntu-latest steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 + with: + sparse-checkout: | + .github + - uses: actions/download-artifact@cbed621e49e4c01b044d60f6c80ea4ed6328b281 + with: + name: s3-dist-path-${{ github.run_id }}.${{ github.run_attempt }} + - name: Clear S3 Caches for Distros + if: ${{ inputs.build_type != 'snapshot' }} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.TOOLS_S3_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.TOOLS_S3_SECRET_KEY }} + AWS_DEFAULT_REGION: us-east-1 + CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} + CLOUDFLARE_CACHE_TOKEN: ${{ secrets.CLOUDFLARE_CACHE_TOKEN }} + run: | + dist_path=`cat s3-dist-path.txt` + echo $dist_path - name: Remove Temp Build Artifacts from S3 id: cleanup-s3-temp-storage env: