Skip to content

Commit

Permalink
GHA: Switch p2 urls in poms to cdn.spring.io/spring-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Nov 17, 2023
1 parent d173af8 commit ca93ab0
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 14 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/aggregate-distro-update-sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
21 changes: 20 additions & 1 deletion .github/workflows/aggregate-ls-extensions-update-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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:
Expand All @@ -31,6 +33,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 }}
Expand All @@ -45,11 +48,27 @@ jobs:
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..."
invalid_urls=""
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/
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/compositeArtifacts.xml "
aws s3 cp ./compositeContent.xml s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/compositeContent.xml "
aws s3 cp ./p2.index s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/
echo "TODO: purge cache!"
invalid_urls+="s3://tools-spring-io/release/TOOLS/sts4-language-server-integrations/p2.index"
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/gh-hosted-eclipse-distro-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ jobs:
purge_cache:
needs: [ eclipse-distro-build, sign-win-distros, sign-osx-distros ]
if: ${{ always() && inputs.build_type == 'snapshot' && contains(join(needs.*.result, ','), 'success')}}
if: ${{ always() && inputs.build_type != 'snapshot' && contains(join(needs.*.result, ','), 'success')}}
runs-on: [self-hosted, macOS]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/snapshot-eclipse-ls-extensions-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ concurrency:

on:
workflow_dispatch:
# push:
# branches:
# - 'main'
push:
branches:
- 'main'

jobs:
eclipse-ls-extensions:
Expand Down
4 changes: 2 additions & 2 deletions eclipse-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<dist.pathpostfix>nightly</dist.pathpostfix>
<dist.path>${dist.type}/${dist.key}/${dist.project}/${dist.pathpostfix}</dist.path>

<sts4-language-servers-p2-repo>https://dist.springsource.com/${dist.type}/TOOLS/sts4-language-server-integrations/${sts4-language-servers-version}</sts4-language-servers-p2-repo>
<sts4-language-servers-p2-repo>https://cdn.spring.io/spring-tools/${dist.type}/TOOLS/sts4-language-server-integrations/${sts4-language-servers-version}</sts4-language-servers-p2-repo>

<tycho-version>4.0.4</tycho-version>
<encoding>UTF-8</encoding>
Expand Down Expand Up @@ -436,7 +436,7 @@
<repository>
<id>p2-thirdparty-bundles</id>
<layout>p2</layout>
<url>https://dist.springsource.com/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
</repository>
<!-- <repository>
<id>egit-github</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<repository>
<id>sts4-language-servers-snapshot</id>
<layout>p2</layout>
<url>https://dist.springsource.com/snapshot/TOOLS/sts4-language-servers/nightly/</url>
<url>https://cdn.spring.io/spring-tools/snapshot/TOOLS/sts4-language-servers/nightly/</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</goals>
<configuration>
<serverId>s3</serverId>
<url>https://dist.springsource.com/release/TOOLS/node-xterm</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/node-xterm</url>
<fromFile>${archive-file}</fromFile>
<toFile>${project.basedir}/lib/node-xterm.zip</toFile>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</goals>
<configuration>
<serverId>s3</serverId>
<url>https://dist.springsource.com/release/TOOLS/node-xterm</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/node-xterm</url>
<fromFile>${archive-file}</fromFile>
<toFile>${project.basedir}/lib/node-xterm.zip</toFile>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</goals>
<configuration>
<serverId>s3</serverId>
<url>https://dist.springsource.com/release/TOOLS/node-xterm</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/node-xterm</url>
<fromFile>${archive-file}</fromFile>
<toFile>${project.basedir}/lib/node-xterm.zip</toFile>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion eclipse-language-servers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
<repository>
<id>p2-thirdparty-bundles</id>
<layout>p2</layout>
<url>https://dist.springsource.com/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
</repository>
</repositories>

Expand Down
2 changes: 1 addition & 1 deletion headless-services/jdt-ls-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<repository>
<id>p2-thirdparty-bundles</id>
<layout>p2</layout>
<url>https://dist.springsource.com/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
<url>https://cdn.spring.io/spring-tools/release/TOOLS/third-party/misc-p2-repo/${misc.p2.repo.version}</url>
</repository>
</repositories>

Expand Down

0 comments on commit ca93ab0

Please sign in to comment.