Skip to content

Commit 235279e

Browse files
committed
Migrate update site to repo.spring.io
Closes gh-263
1 parent d191676 commit 235279e

File tree

4 files changed

+22
-27
lines changed

4 files changed

+22
-27
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ You can also add a `.eclipse/eclipse.properties` file to customize the following
193193
To install the plugin use the `io.spring.javaformat.eclipse.site` zip file.
194194
You can download the latest version from
195195
https://repo.spring.io/release/io/spring/javaformat/io.spring.javaformat.eclipse.site/{release-version}[repo.spring.io]
196-
or use the https://dl.bintray.com/spring/javaformat-eclipse/[update site].
196+
or use the https://repo.spring.io/javaformat-eclipse-update-site/[update site].
197197

198198
=== IntelliJ IDEA
199199
The IntelliJ IDEA plugin provides custom formatter support for IntelliJ IDEA.

ci/pipeline.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@ jobs:
200200
- task: publish-eclipse-update-site
201201
image: ci-image
202202
file: git-repo/ci/tasks/publish-eclipse-update-site.yml
203-
params:
204-
BINTRAY_USERNAME: ((bintray-username))
205-
BINTRAY_API_KEY: ((bintray-api-key))
206203
groups:
207204
- name: "builds"
208205
jobs: ["build"]

ci/scripts/publish-eclipse-update-site.sh

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,23 @@ groupId=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].i
99
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
1010

1111
echo "Publishing ${buildName}/${buildNumber} to Eclipse Update Site"
12-
# We need to push twice for some reason otherwise we get out of date versions
13-
for i in {1..2}; do
14-
curl \
15-
-s \
16-
--connect-timeout 240 \
17-
--max-time 2700 \
18-
-u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \
19-
-f \
20-
-X PUT \
21-
-T "artifactory-repo/io/spring/javaformat/io.spring.javaformat.eclipse.site/${version}/io.spring.javaformat.eclipse.site-${version}.zip" \
22-
"https://api.bintray.com/content/spring/javaformat-eclipse/update-site/${version}/${version}/site.zip?explode=1&publish=1" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
23-
releasedVersions=$( curl -f -X GET https://api.bintray.com/packages/spring/javaformat-eclipse/update-site | jq -r '.versions[]' )
24-
sleep 30
25-
done
26-
27-
respositories=""
12+
curl \
13+
-s \
14+
--connect-timeout 240 \
15+
--max-time 2700 \
16+
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \
17+
-f \
18+
-H "X-Explode-Archive: true"
19+
-X PUT \
20+
-T "artifactory-repo/io/spring/javaformat/io.spring.javaformat.eclipse.site/${version}/io.spring.javaformat.eclipse.site-${version}.zip" \
21+
"https://repo.spring.io/javaformat-eclipse-update-site/${version}" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
22+
23+
releasedVersions=$( curl -s -f -X GET https://repo.spring.io/api/storage/javaformat-eclipse-update-site | jq -r '.children[] | .uri' | cut -c 2- | grep '\d.*' | sort -V )
24+
25+
repositories=""
2826
while read -r releasedVersion; do
2927
echo "Adding repository for ${releasedVersion}"
30-
respositories="${respositories}<repository><url>https://dl.bintray.com/spring/javaformat-eclipse/${releasedVersion}</url><layout>p2</layout></repository>"
28+
repositories="${repositories}<repository><url>https://repo.spring.io/javaformat-eclipse-update-site/${releasedVersion}</url><layout>p2</layout></repository>"
3129
done <<< "${releasedVersions}"
3230

3331
pushd git-repo > /dev/null
@@ -38,21 +36,21 @@ curl \
3836
-s \
3937
--connect-timeout 240 \
4038
--max-time 2700 \
41-
-u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \
39+
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \
4240
-f \
4341
-X PUT \
4442
-T "target/repository/content.jar" \
45-
"https://api.bintray.com/content/spring/javaformat-eclipse/content.jar" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
43+
"https://repo.spring.io/javaformat-eclipse-update-site" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
4644

4745
curl \
4846
-s \
4947
--connect-timeout 240 \
5048
--max-time 2700 \
51-
-u ${BINTRAY_USERNAME}:${BINTRAY_API_KEY} \
49+
-u ${ARTIFACTORY_USERNAME}:${ARTIFACTORY_PASSWORD} \
5250
-f \
5351
-X PUT \
5452
-T "target/repository/artifacts.jar" \
55-
"https://api.bintray.com/content/spring/javaformat-eclipse/artifacts.jar" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
53+
"https://repo.spring.io/javaformat-eclipse-update-site" > /dev/null || { echo "Failed to publish" >&2; exit 1; }
5654

5755
popd > /dev/null
5856

ci/tasks/publish-eclipse-update-site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
- name: git-repo
55
- name: artifactory-repo
66
params:
7-
BINTRAY_USERNAME:
8-
BINTRAY_API_KEY:
7+
ARTIFACTORY_USERNAME: ((artifactory-username))
8+
ARTIFACTORY_PASSWORD: ((artifactory-password))
99
run:
1010
path: git-repo/ci/scripts/publish-eclipse-update-site.sh

0 commit comments

Comments
 (0)