diff --git a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java index 20b82cda15..40dd11a88b 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java @@ -31,7 +31,7 @@ import org.gradle.api.Project; import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.Sync; -import org.springframework.boot.build.artifactory.ArtifactoryRepository; +import org.springframework.boot.build.artifacts.ArtifactRelease; import org.springframework.util.StringUtils; /** @@ -67,6 +67,7 @@ import org.springframework.util.StringUtils; * * * @author Andy Wilkinson + * @author Scott Frederick */ class AsciidoctorConventions { @@ -130,10 +131,12 @@ class AsciidoctorConventions { } private void configureCommonAttributes(Project project, AbstractAsciidoctorTask asciidoctorTask) { + ArtifactRelease artifacts = ArtifactRelease.forProject(project); Map attributes = new HashMap<>(); attributes.put("attribute-missing", "warn"); attributes.put("github-tag", determineGitHubTag(project)); - attributes.put("spring-boot-artifactory-repo", ArtifactoryRepository.forProject(project)); + attributes.put("artifact-release-type", artifacts.getType()); + attributes.put("artifact-download-repo", artifacts.getDownloadRepo()); attributes.put("revnumber", null); asciidoctorTask.attributes(attributes); } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java b/buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java deleted file mode 100644 index 12c9b7f8bb..0000000000 --- a/buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.build.artifactory; - -import org.gradle.api.Project; - -/** - * An Artifactory repository to which a build of Spring Boot can be published. - * - * @author Andy Wilkinson - */ -public final class ArtifactoryRepository { - - private final String name; - - private ArtifactoryRepository(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - - @Override - public String toString() { - return this.name; - } - - public static ArtifactoryRepository forProject(Project project) { - return new ArtifactoryRepository(determineArtifactoryRepo(project)); - } - - private static String determineArtifactoryRepo(Project project) { - String version = project.getVersion().toString(); - int modifierIndex = version.lastIndexOf('-'); - if (modifierIndex == -1) { - return "release"; - } - String type = version.substring(modifierIndex + 1); - if (type.startsWith("M") || type.startsWith("RC")) { - return "milestone"; - } - return "snapshot"; - } - -} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/artifacts/ArtifactRelease.java b/buildSrc/src/main/java/org/springframework/boot/build/artifacts/ArtifactRelease.java new file mode 100644 index 0000000000..31a74a56c7 --- /dev/null +++ b/buildSrc/src/main/java/org/springframework/boot/build/artifacts/ArtifactRelease.java @@ -0,0 +1,74 @@ +/* + * Copyright 2012-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.artifacts; + +import org.gradle.api.Project; + +/** + * Information about artifacts produced by a build. + * + * @author Andy Wilkinson + * @author Scott Frederick + */ +public final class ArtifactRelease { + + private static final String SNAPSHOT = "snapshot"; + + private static final String MILESTONE = "milestone"; + + private static final String RELEASE = "release"; + + private static final String SPRING_REPO = "https://repo.spring.io/%s"; + + private static final String MAVEN_REPO = "https://repo.maven.apache.org/maven2"; + + private final String type; + + private ArtifactRelease(String type) { + this.type = type; + } + + public String getType() { + return this.type; + } + + public String getDownloadRepo() { + return (this.isRelease()) ? MAVEN_REPO : String.format(SPRING_REPO, this.getType()); + } + + public boolean isRelease() { + return RELEASE.equals(this.type); + } + + public static ArtifactRelease forProject(Project project) { + return new ArtifactRelease(determineReleaseType(project)); + } + + private static String determineReleaseType(Project project) { + String version = project.getVersion().toString(); + int modifierIndex = version.lastIndexOf('-'); + if (modifierIndex == -1) { + return RELEASE; + } + String type = version.substring(modifierIndex + 1); + if (type.startsWith("M") || type.startsWith("RC")) { + return MILESTONE; + } + return SNAPSHOT; + } + +} diff --git a/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java b/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java index b2d4ea1f90..e6903d1b8c 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/cli/AbstractPackageManagerDefinitionTask.java @@ -23,6 +23,7 @@ import java.util.Map; import org.apache.commons.codec.digest.DigestUtils; import org.gradle.api.DefaultTask; +import org.gradle.api.Project; import org.gradle.api.file.RegularFile; import org.gradle.api.provider.Provider; import org.gradle.api.tasks.InputFile; @@ -31,13 +32,14 @@ import org.gradle.api.tasks.PathSensitive; import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.TaskExecutionException; -import org.springframework.boot.build.artifactory.ArtifactoryRepository; +import org.springframework.boot.build.artifacts.ArtifactRelease; /** * Base class for generating a package manager definition file such as a Scoop manifest or * a Homebrew formula. * * @author Andy Wilkinson + * @author Phillip Webb */ public abstract class AbstractPackageManagerDefinitionTask extends DefaultTask { @@ -84,14 +86,19 @@ public abstract class AbstractPackageManagerDefinitionTask extends DefaultTask { getProject().copy((copy) -> { copy.from(this.template); copy.into(this.outputDir); - Map properties = new HashMap<>(additionalProperties); - properties.put("hash", sha256(this.archive.get().getAsFile())); - properties.put("repo", ArtifactoryRepository.forProject(getProject())); - properties.put("project", getProject()); - copy.expand(properties); + copy.expand(getProperties(additionalProperties)); }); } + private Map getProperties(Map additionalProperties) { + Map properties = new HashMap<>(additionalProperties); + Project project = getProject(); + properties.put("hash", sha256(this.archive.get().getAsFile())); + properties.put("repo", ArtifactRelease.forProject(project).getDownloadRepo()); + properties.put("project", project); + return properties; + } + private String sha256(File file) { try { MessageDigest digest = MessageDigest.getInstance("SHA-256"); diff --git a/buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java b/buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java deleted file mode 100644 index f878e1afdf..0000000000 --- a/buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.boot.build.artifactory; - -import org.gradle.api.Project; -import org.gradle.testfixtures.ProjectBuilder; -import org.junit.jupiter.api.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests for {@link ArtifactoryRepository}. - * - * @author Andy Wilkinson - */ -class ArtifactoryRepositoryTests { - - @Test - void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() { - Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3-M1"); - assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone"); - } - - @Test - void whenProjectVersionIsReleaseCandidateThenRepositoryIsMilestone() { - Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3-RC1"); - assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone"); - } - - @Test - void whenProjectVersionIsReleaseThenRepositoryIsRelease() { - Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3"); - assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("release"); - } - - @Test - void whenProjectVersionIsSnapshotThenRepositoryIsSnapshot() { - Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3-SNAPSHOT"); - assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("snapshot"); - } - -} diff --git a/buildSrc/src/test/java/org/springframework/boot/build/artifacts/ArtifactReleaseTests.java b/buildSrc/src/test/java/org/springframework/boot/build/artifacts/ArtifactReleaseTests.java new file mode 100644 index 0000000000..0a9d5e420a --- /dev/null +++ b/buildSrc/src/test/java/org/springframework/boot/build/artifacts/ArtifactReleaseTests.java @@ -0,0 +1,90 @@ +/* + * Copyright 2012-2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.build.artifacts; + +import org.gradle.api.Project; +import org.gradle.testfixtures.ProjectBuilder; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ArtifactRelease}. + * + * @author Andy Wilkinson + * @author Scott Frederick + */ +class ArtifactReleaseTests { + + @Test + void whenProjectVersionIsSnapshotThenTypeIsSnapshot() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-SNAPSHOT"); + assertThat(ArtifactRelease.forProject(project).getType()).isEqualTo("snapshot"); + } + + @Test + void whenProjectVersionIsMilestoneThenTypeIsMilestone() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-M1"); + assertThat(ArtifactRelease.forProject(project).getType()).isEqualTo("milestone"); + } + + @Test + void whenProjectVersionIsReleaseCandidateThenTypeIsMilestone() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-RC1"); + assertThat(ArtifactRelease.forProject(project).getType()).isEqualTo("milestone"); + } + + @Test + void whenProjectVersionIsReleaseThenTypeIsRelease() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3"); + assertThat(ArtifactRelease.forProject(project).getType()).isEqualTo("release"); + } + + @Test + void whenProjectVersionIsSnapshotThenRepositoryIsArtifactorySnapshot() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-SNAPSHOT"); + assertThat(ArtifactRelease.forProject(project).getDownloadRepo()).contains("repo.spring.io/snapshot"); + } + + @Test + void whenProjectVersionIsMilestoneThenRepositoryIsArtifactoryMilestone() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-M1"); + assertThat(ArtifactRelease.forProject(project).getDownloadRepo()).contains("repo.spring.io/milestone"); + } + + @Test + void whenProjectVersionIsReleaseCandidateThenRepositoryIsArtifactoryMilestone() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3-RC1"); + assertThat(ArtifactRelease.forProject(project).getDownloadRepo()).contains("repo.spring.io/milestone"); + } + + @Test + void whenProjectVersionIsReleaseThenRepositoryIsMavenCentral() { + Project project = ProjectBuilder.builder().build(); + project.setVersion("1.2.3"); + assertThat(ArtifactRelease.forProject(project).getDownloadRepo()) + .contains("https://repo.maven.apache.org/maven2"); + } + +} diff --git a/ci/images/ci-image-jdk11/Dockerfile b/ci/images/ci-image-jdk11/Dockerfile index 8b3ca4c1a1..714275083c 100644 --- a/ci/images/ci-image-jdk11/Dockerfile +++ b/ci/images/ci-image-jdk11/Dockerfile @@ -8,5 +8,3 @@ RUN ./setup.sh java11 ENV JAVA_HOME /opt/openjdk ENV PATH $JAVA_HOME/bin:$PATH ADD docker-lib.sh /docker-lib.sh - -ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/images/ci-image-jdk17/Dockerfile b/ci/images/ci-image-jdk17/Dockerfile index 934ed8e8e0..216f1487fd 100644 --- a/ci/images/ci-image-jdk17/Dockerfile +++ b/ci/images/ci-image-jdk17/Dockerfile @@ -8,5 +8,3 @@ RUN ./setup.sh java8 java17 ENV JAVA_HOME /opt/openjdk ENV PATH $JAVA_HOME/bin:$PATH ADD docker-lib.sh /docker-lib.sh - -ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/images/ci-image-jdk19/Dockerfile b/ci/images/ci-image-jdk19/Dockerfile index 8700d8b697..b9540460f2 100644 --- a/ci/images/ci-image-jdk19/Dockerfile +++ b/ci/images/ci-image-jdk19/Dockerfile @@ -8,5 +8,3 @@ RUN ./setup.sh java8 java19 ENV JAVA_HOME /opt/openjdk ENV PATH $JAVA_HOME/bin:$PATH ADD docker-lib.sh /docker-lib.sh - -ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/images/ci-image/Dockerfile b/ci/images/ci-image/Dockerfile index bbf95f24dc..0418aa95cd 100644 --- a/ci/images/ci-image/Dockerfile +++ b/ci/images/ci-image/Dockerfile @@ -12,4 +12,3 @@ ADD docker-lib.sh /docker-lib.sh ADD build-release-scripts.sh /build-release-scripts.sh ADD releasescripts /release-scripts RUN ./build-release-scripts.sh -ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ] diff --git a/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java b/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java index c0e38cc0be..897df837f8 100644 --- a/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java +++ b/ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java @@ -40,7 +40,7 @@ public class SdkmanService { private static final String SDKMAN_URL = "https://vendors.sdkman.io/"; - private static final String DOWNLOAD_URL = "https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/" + private static final String DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/" + "%s/spring-boot-cli-%s-bin.zip"; private static final String CHANGELOG_URL = "https://github.com/spring-projects/spring-boot/releases/tag/v%s"; diff --git a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java index 419392e523..3a81ecfd3f 100644 --- a/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java +++ b/ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ class SdkmanServiceTests { @Test void publishWhenMakeDefaultTrue() { setupExpectation("https://vendors.sdkman.io/release", - "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); + "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); setupExpectation("https://vendors.sdkman.io/default", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\"}", HttpMethod.PUT); setupExpectation("https://vendors.sdkman.io/announce/struct", @@ -67,7 +67,7 @@ class SdkmanServiceTests { @Test void publishWhenMakeDefaultFalse() { setupExpectation("https://vendors.sdkman.io/release", - "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); + "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}"); setupExpectation("https://vendors.sdkman.io/announce/struct", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}"); this.service.publish("1.2.3", false); diff --git a/ci/parameters.yml b/ci/parameters.yml index eb59e390b5..a12867e15d 100644 --- a/ci/parameters.yml +++ b/ci/parameters.yml @@ -1,6 +1,3 @@ -email-server: "smtp.svc.pivotal.io" -email-from: "ci@spring.io" -email-to: ["spring-boot-dev@pivotal.io"] github-repo: "https://github.com/spring-projects/spring-boot.git" github-repo-name: "spring-projects/spring-boot" homebrew-tap-repo: "https://github.com/spring-io/homebrew-tap.git" diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 37651e5669..1d574981e8 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -7,11 +7,10 @@ anchors: registry-image-resource-source: ®istry-image-resource-source username: ((docker-hub-username)) password: ((docker-hub-password)) + ci-registry-image-resource-source: &ci-registry-image-resource-source + username: ((docker-hub-username)) + password: ((docker-hub-password)) tag: ((milestone)) - registry_mirror: - host: ((docker-hub-mirror)) - username: ((docker-hub-mirror-username)) - password: ((docker-hub-mirror-password)) gradle-enterprise-task-params: &gradle-enterprise-task-params GRADLE_ENTERPRISE_ACCESS_KEY: ((gradle_enterprise_secret_access_key)) GRADLE_ENTERPRISE_CACHE_URL: ((gradle_enterprise_cache_url)) @@ -21,6 +20,7 @@ anchors: DOCKER_HUB_MIRROR: ((docker-hub-mirror)) DOCKER_HUB_USERNAME: ((docker-hub-username)) DOCKER_HUB_PASSWORD: ((docker-hub-password)) + DOCKER_HUB_AUTH: ((docker-hub-auth)) github-task-params: &github-task-params GITHUB_REPO: spring-boot GITHUB_ORGANIZATION: spring-projects @@ -61,7 +61,7 @@ anchors: repo: libs-snapshot-local folder: distribution-repository build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}" - build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}" + build_number: "${BUILD_JOB_NAME}-${BUILD_NAME}" disable_checksum_uploads: true threads: 8 artifact_set: @@ -94,41 +94,43 @@ anchors: gradle-publish-params: &gradle-publish-params GRADLE_PUBLISH_KEY: ((gradle-publish-key)) GRADLE_PUBLISH_SECRET: ((gradle-publish-secret)) - docker-hub-mirror-vars: &docker-hub-mirror-vars - docker-hub-mirror: ((docker-hub-mirror)) - docker-hub-mirror-username: ((docker-hub-mirror-username)) - docker-hub-mirror-password: ((docker-hub-mirror-password)) resource_types: - name: registry-image type: registry-image source: + <<: *registry-image-resource-source repository: concourse/registry-image-resource - tag: 1.5.0 + tag: 1.7.1 - name: artifactory-resource type: registry-image source: + <<: *registry-image-resource-source repository: springio/artifactory-resource - tag: 0.0.17 + tag: 0.0.18 - name: pull-request type: registry-image source: + <<: *registry-image-resource-source repository: teliaoss/github-pr-resource tag: v0.23.0 - name: github-status-resource type: registry-image source: + <<: *registry-image-resource-source repository: dpb587/github-status-resource tag: master - name: slack-notification type: registry-image source: + <<: *registry-image-resource-source repository: cfcommunity/slack-notification-resource tag: latest - name: github-release type: registry-image source: + <<: *registry-image-resource-source repository: concourse/github-release-resource - tag: 1.5.5 + tag: 1.8.0 resources: - name: git-repo type: git @@ -179,25 +181,25 @@ resources: type: registry-image icon: docker source: - <<: *registry-image-resource-source + <<: *ci-registry-image-resource-source repository: ((docker-hub-organization))/spring-boot-ci - name: ci-image-jdk11 type: registry-image icon: docker source: - <<: *registry-image-resource-source + <<: *ci-registry-image-resource-source repository: ((docker-hub-organization))/spring-boot-ci-jdk11 - name: ci-image-jdk17 type: registry-image icon: docker source: - <<: *registry-image-resource-source + <<: *ci-registry-image-resource-source repository: ((docker-hub-organization))/spring-boot-ci-jdk17 - name: ci-image-jdk19 type: registry-image icon: docker source: - <<: *registry-image-resource-source + <<: *ci-registry-image-resource-source repository: ((docker-hub-organization))/spring-boot-ci-jdk19 - name: paketo-builder-base-image type: registry-image @@ -213,6 +215,8 @@ resources: username: ((artifactory-username)) password: ((artifactory-password)) build_name: ((build-name)) + build_number_prefix: "${BUILD_PIPELINE_NAME}-" + check_limit: 500 - name: repo-status-build type: github-status-resource icon: eye-check-outline @@ -280,7 +284,6 @@ jobs: image: ci-image vars: ci-image-name: ci-image - <<: *docker-hub-mirror-vars - task: build-ci-image-jdk11 privileged: true file: git-repo/ci/tasks/build-ci-image.yml @@ -288,7 +291,6 @@ jobs: image: ci-image-jdk11 vars: ci-image-name: ci-image-jdk11 - <<: *docker-hub-mirror-vars - task: build-ci-image-jdk17 privileged: true file: git-repo/ci/tasks/build-ci-image.yml @@ -296,7 +298,6 @@ jobs: image: ci-image-jdk17 vars: ci-image-name: ci-image-jdk17 - <<: *docker-hub-mirror-vars - task: build-ci-image-jdk19 privileged: true file: git-repo/ci/tasks/build-ci-image.yml @@ -304,7 +305,6 @@ jobs: image: ci-image-jdk19 vars: ci-image-name: ci-image-jdk19 - <<: *docker-hub-mirror-vars - in_parallel: - put: ci-image params: @@ -640,8 +640,6 @@ jobs: RELEASE_TYPE: M GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) - vars: - <<: *docker-hub-mirror-vars - put: github-pre-release params: name: generated-changelog/tag @@ -671,8 +669,6 @@ jobs: RELEASE_TYPE: RC GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) - vars: - <<: *docker-hub-mirror-vars - put: github-pre-release params: name: generated-changelog/tag @@ -732,8 +728,6 @@ jobs: RELEASE_TYPE: RELEASE GITHUB_USERNAME: ((github-username)) GITHUB_TOKEN: ((github-ci-release-token)) - vars: - <<: *docker-hub-mirror-vars - put: github-release params: name: generated-changelog/tag diff --git a/ci/scripts/detect-jdk-updates.sh b/ci/scripts/detect-jdk-updates.sh index c43206bb7d..9ff07bc05d 100755 --- a/ci/scripts/detect-jdk-updates.sh +++ b/ci/scripts/detect-jdk-updates.sh @@ -43,7 +43,7 @@ if [[ $current = $latest ]]; then exit 0; fi -milestone_response=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open ) +milestone_response=$( curl -s -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open ) milestone_result=$( jq -r -c --arg MILESTONE "$MILESTONE" '.[] | select(has("title")) | select(.title==$MILESTONE)' <<< "$milestone_response" ) if [[ ${milestone_result} = "null" || ${milestone_result} = "" ]]; then echo "Could not parse milestone: $milestone_response" @@ -51,7 +51,7 @@ if [[ ${milestone_result} = "null" || ${milestone_result} = "" ]]; then fi milestone_number=$( jq -r '.number' <<< "$milestone_result" ) -existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-builds\&milestone\=${milestone_number} ) +existing_tasks=$( curl -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-builds\&milestone\=${milestone_number} ) existing_jdk_issues=$( jq -r -c --arg TITLE "$ISSUE_TITLE" '.[] | select(has("title")) | select(.title==$TITLE)' <<< "$existing_tasks" ) if [[ ${existing_jdk_issues} = "" ]]; then diff --git a/ci/scripts/detect-ubuntu-image-updates.sh b/ci/scripts/detect-ubuntu-image-updates.sh index 6f0d85cb67..cbdfc062df 100755 --- a/ci/scripts/detect-ubuntu-image-updates.sh +++ b/ci/scripts/detect-ubuntu-image-updates.sh @@ -11,8 +11,8 @@ if [[ $current = $latest ]]; then exit 0; fi -milestone_number=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open | jq -c --arg MILESTONE "$MILESTONE" '.[] | select(.title==$MILESTONE)' | jq -r '.number') -existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-builds\&milestone\=${milestone_number} ) +milestone_number=$( curl -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/milestones\?state\=open | jq -c --arg MILESTONE "$MILESTONE" '.[] | select(.title==$MILESTONE)' | jq -r '.number') +existing_tasks=$( curl -u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-builds\&milestone\=${milestone_number} ) existing_upgrade_issues=$( echo "$existing_tasks" | jq -c --arg TITLE "$ISSUE_TITLE" '.[] | select(.title==$TITLE)' ) if [[ ${existing_upgrade_issues} = "" ]]; then diff --git a/ci/scripts/update-homebrew-tap.sh b/ci/scripts/update-homebrew-tap.sh index 591f595413..6c703eaf31 100755 --- a/ci/scripts/update-homebrew-tap.sh +++ b/ci/scripts/update-homebrew-tap.sh @@ -7,7 +7,7 @@ git clone homebrew-tap-repo updated-homebrew-tap-repo > /dev/null if [[ $LATEST_GA = true ]]; then pushd updated-homebrew-tap-repo > /dev/null - curl https://repo.spring.io/libs-release-local/org/springframework/boot/spring-boot-cli/${version}/spring-boot-cli-${version}-homebrew.rb --output spring-boot-cli-${version}-homebrew.rb + curl https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-cli/${version}/spring-boot-cli-${version}-homebrew.rb --output spring-boot-cli-${version}-homebrew.rb rm spring-boot.rb mv spring-boot-cli-*.rb spring-boot.rb git config user.name "Spring Builds" > /dev/null diff --git a/ci/tasks/build-ci-image.yml b/ci/tasks/build-ci-image.yml index b50749b19e..a57af31acd 100644 --- a/ci/tasks/build-ci-image.yml +++ b/ci/tasks/build-ci-image.yml @@ -5,10 +5,8 @@ image_resource: source: repository: concourse/oci-build-task tag: 0.10.0 - registry_mirror: - host: ((docker-hub-mirror)) - username: ((docker-hub-mirror-username)) - password: ((docker-hub-mirror-password)) + username: ((docker-hub-username)) + password: ((docker-hub-password)) inputs: - name: ci-images-git-repo outputs: diff --git a/ci/tasks/build-project.yml b/ci/tasks/build-project.yml index c3c9775e8d..db3003af6e 100644 --- a/ci/tasks/build-project.yml +++ b/ci/tasks/build-project.yml @@ -20,8 +20,12 @@ params: run: path: bash args: - - -ec - - | - source /docker-lib.sh - start_docker $DOCKER_HUB_MIRROR - ${PWD}/git-repo/ci/scripts/build-project.sh + - "-ec" + - | + mkdir -p /root/.docker + cat > /root/.docker/config.json < - + url="https://repo.maven.apache.org/maven2/.m2e/connectors/m2eclipse-buildhelper/0.15.0/N/0.15.0.201405280027/"/> + excludedWorkingSet="//@setupTasks.8/@workingSets[name='spring-boot-smoke-tests'] //@setupTasks.8/@workingSets[name='spring-boot-starters'] //@setupTasks.8/@workingSets[name='spring-boot-tests'] //@setupTasks.8/@workingSets[name='spring-boot-tools']"/> repositoryConfigurations = new ArrayList<>(); repositoryConfigurations - .add(new RepositoryConfiguration("central", URI.create("https://repo1.maven.org/maven2"), false)); + .add(new RepositoryConfiguration("central", URI.create("https://repo.maven.apache.org/maven2"), false)); repositoryConfigurations.addAll(Arrays.asList(additionalRepositories)); DependencyResolutionContext dependencyResolutionContext = new DependencyResolutionContext(); dependencyResolutionContext.addDependencyManagement(new SpringBootDependenciesDependencyManagement()); diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc index 1e9943f369..a801fdaffa 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/attributes.adoc @@ -11,7 +11,7 @@ :docinfo: shared,private :attribute-missing: warn :chomp: default headers packages -:spring-boot-artifactory-repo: snapshot +:artifact-release-type: snapshot :github-tag: main :spring-boot-version: current :github-repo: spring-projects/spring-boot diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc index 8e29e19070..1091289e21 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/first-application.adoc @@ -61,8 +61,8 @@ Open your favorite text editor and add the following: -ifeval::["{spring-boot-artifactory-repo}" != "release"] - +ifeval::["{artifact-release-type}" != "release"] + spring-snapshots diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc index 0ad32e14b6..4f4f835551 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/getting-started/installing.adoc @@ -74,13 +74,16 @@ You do not need to use the CLI to work with Spring Boot, but it is a quick way t [[getting-started.installing.cli.manual-installation]] ==== Manual Installation -You can download the Spring CLI distribution from the Spring software repository: +ifeval::["{artifact-release-type}" == "snapshot"] +You can download one of the `spring-boot-cli-\*-bin.zip` or `spring-boot-cli-*-bin.tar.gz` files from the {artifact-download-repo}/org/springframework/boot/spring-boot-cli/{spring-boot-version}/[Spring software repository]. +endif::[] +ifeval::["{artifact-release-type}" != "snapshot"] +You can download the Spring CLI distribution from one of the following locations: -* https://repo.spring.io/{spring-boot-artifactory-repo}/org/springframework/boot/spring-boot-cli/{spring-boot-version}/spring-boot-cli-{spring-boot-version}-bin.zip[spring-boot-cli-{spring-boot-version}-bin.zip] -* https://repo.spring.io/{spring-boot-artifactory-repo}/org/springframework/boot/spring-boot-cli/{spring-boot-version}/spring-boot-cli-{spring-boot-version}-bin.tar.gz[spring-boot-cli-{spring-boot-version}-bin.tar.gz] +* {artifact-download-repo}/org/springframework/boot/spring-boot-cli/{spring-boot-version}/spring-boot-cli-{spring-boot-version}-bin.zip[spring-boot-cli-{spring-boot-version}-bin.zip] +* {artifact-download-repo}/org/springframework/boot/spring-boot-cli/{spring-boot-version}/spring-boot-cli-{spring-boot-version}-bin.tar.gz[spring-boot-cli-{spring-boot-version}-bin.tar.gz] +endif::[] -Cutting edge -https://repo.spring.io/snapshot/org/springframework/boot/spring-boot-cli/[snapshot distributions] are also available. Once downloaded, follow the {github-raw}/spring-boot-project/spring-boot-cli/src/main/content/INSTALL.txt[INSTALL.txt] instructions from the unpacked archive. In summary, there is a `spring` script (`spring.bat` for Windows) in a `bin/` directory in the `.zip` file. diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc index 2c5d3dd5df..5828e3b8d9 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/getting-started.adoc @@ -2,7 +2,7 @@ = Getting Started To get started with the plugin it needs to be applied to your project. -ifeval::["{spring-boot-artifactory-repo}" == "release"] +ifeval::["{artifact-release-type}" == "release"] The plugin is https://plugins.gradle.org/plugin/org.springframework.boot[published to Gradle's plugin portal] and can be applied using the `plugins` block: [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy @@ -16,7 +16,7 @@ include::../gradle/getting-started/apply-plugin-release.gradle[] include::../gradle/getting-started/apply-plugin-release.gradle.kts[] ---- endif::[] -ifeval::["{spring-boot-artifactory-repo}" == "milestone"] +ifeval::["{artifact-release-type}" == "milestone"] The plugin is published to the Spring milestones repository. Gradle can be configured to use the milestones repository and the plugin can then be applied using the `plugins` block. To configure Gradle to use the milestones repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): @@ -47,7 +47,7 @@ include::../gradle/getting-started/apply-plugin-release.gradle[] include::../gradle/getting-started/apply-plugin-release.gradle.kts[] ---- endif::[] -ifeval::["{spring-boot-artifactory-repo}" == "snapshot"] +ifeval::["{artifact-release-type}" == "snapshot"] The plugin is published to the Spring snapshots repository. Gradle can be configured to use the snapshots repository and the plugin can then be applied using the `plugins` block. To configure Gradle to use the snapshots repository, add the following to your `settings.gradle` (Groovy) or `settings.gradle.kts` (Kotlin): diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc index 68d42db000..0b6be6238f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/managing-dependencies.adoc @@ -58,7 +58,7 @@ The `SpringBootPlugin` class provides a `BOM_COORDINATES` constant that can be u First, configure the project to depend on the Spring Boot plugin but do not apply it: -ifeval::["{spring-boot-artifactory-repo}" == "release"] +ifeval::["{artifact-release-type}" == "release"] [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy ---- @@ -71,7 +71,7 @@ include::../gradle/managing-dependencies/depend-on-plugin-release.gradle[] include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[] ---- endif::[] -ifeval::["{spring-boot-artifactory-repo}" == "milestone"] +ifeval::["{artifact-release-type}" == "milestone"] [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy ---- @@ -83,7 +83,7 @@ include::../gradle/managing-dependencies/depend-on-plugin-milestone.gradle[] include::../gradle/managing-dependencies/depend-on-plugin-release.gradle.kts[] ---- endif::[] -ifeval::["{spring-boot-artifactory-repo}" == "snapshot"] +ifeval::["{artifact-release-type}" == "snapshot"] [source,groovy,indent=0,subs="verbatim,attributes",role="primary"] .Groovy ----