From 8e8548756e46701b34d7478ba19e3703d05c1d82 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 28 May 2020 10:52:18 +0100 Subject: [PATCH] Start work on Spring Boot 2.4 --- .../boot/build/artifactory/ArtifactoryRepository.java | 5 +++-- .../build/artifactory/ArtifactoryRepositoryTests.java | 10 +++++----- ci/README.adoc | 2 +- ci/images/setup.sh | 2 +- ci/parameters.yml | 2 +- ci/pipeline.yml | 6 +++--- ci/scripts/generate-release-notes.sh | 3 --- gradle.properties | 2 +- 8 files changed, 15 insertions(+), 17 deletions(-) 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 index 0a985d5c27..12c9b7f8bb 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java @@ -46,10 +46,11 @@ public final class ArtifactoryRepository { private static String determineArtifactoryRepo(Project project) { String version = project.getVersion().toString(); - String type = version.substring(version.lastIndexOf('.') + 1); - if (type.equals("RELEASE")) { + int modifierIndex = version.lastIndexOf('-'); + if (modifierIndex == -1) { return "release"; } + String type = version.substring(modifierIndex + 1); if (type.startsWith("M") || type.startsWith("RC")) { return "milestone"; } 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 index 3216f9e347..050dcdd349 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java @@ -32,28 +32,28 @@ public class ArtifactoryRepositoryTests { @Test void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() { Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3.M1"); + 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"); + 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.RELEASE"); + project.setVersion("1.2.3"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("release"); } @Test - void whenProjectVersionIsBuildSnapshotThenRepositoryIsSnapshot() { + void whenProjectVersionIsSnapshotThenRepositoryIsSnapshot() { Project project = ProjectBuilder.builder().build(); - project.setVersion("1.2.3.BUILD-SNAPSHOT"); + project.setVersion("1.2.3-SNAPSHOT"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("snapshot"); } diff --git a/ci/README.adoc b/ci/README.adoc index b6c207af4f..93540cec5d 100644 --- a/ci/README.adoc +++ b/ci/README.adoc @@ -11,7 +11,7 @@ The pipeline can be deployed using the following command: [source] ---- -$ fly -t spring-boot set-pipeline -p spring-boot-2.3.x -c ci/pipeline.yml -l ci/parameters.yml +$ fly -t spring-boot set-pipeline -p spring-boot-2.4.x -c ci/pipeline.yml -l ci/parameters.yml ---- NOTE: This assumes that you have credhub integration configured with the appropriate diff --git a/ci/images/setup.sh b/ci/images/setup.sh index 1819c8868c..a4b6d60f8e 100755 --- a/ci/images/setup.sh +++ b/ci/images/setup.sh @@ -9,7 +9,7 @@ apt-get update apt-get install --no-install-recommends -y ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq rm -rf /var/lib/apt/lists/* -curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.2/concourse-java.sh > /opt/concourse-java.sh +curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.3/concourse-java.sh > /opt/concourse-java.sh ########################################################### diff --git a/ci/parameters.yml b/ci/parameters.yml index c9515ba6c1..71bbc03f63 100644 --- a/ci/parameters.yml +++ b/ci/parameters.yml @@ -6,7 +6,7 @@ github-repo-name: "spring-projects/spring-boot" docker-hub-organization: "springci" artifactory-server: "https://repo.spring.io" branch: "master" -milestone: "2.3.x" +milestone: "2.4.x" build-name: "spring-boot" pipeline-name: "spring-boot" concourse-url: "https://ci.spring.io" diff --git a/ci/pipeline.yml b/ci/pipeline.yml index 5fb5557899..c54be7cd4a 100644 --- a/ci/pipeline.yml +++ b/ci/pipeline.yml @@ -77,7 +77,7 @@ resources: repository: ((docker-hub-organization))/spring-boot-ci-image username: ((docker-hub-username)) password: ((docker-hub-password)) - tag: 2.3.x + tag: 2.4.x - name: spring-boot-jdk11-ci-image type: docker-image icon: docker @@ -85,7 +85,7 @@ resources: repository: ((docker-hub-organization))/spring-boot-jdk11-ci-image username: ((docker-hub-username)) password: ((docker-hub-password)) - tag: 2.3.x + tag: 2.4.x - name: spring-boot-jdk14-ci-image type: docker-image icon: docker @@ -93,7 +93,7 @@ resources: repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image username: ((docker-hub-username)) password: ((docker-hub-password)) - tag: 2.3.x + tag: 2.4.x - name: artifactory-repo type: artifactory-resource icon: package-variant diff --git a/ci/scripts/generate-release-notes.sh b/ci/scripts/generate-release-notes.sh index aa84b8dd54..0f12a3bc30 100755 --- a/ci/scripts/generate-release-notes.sh +++ b/ci/scripts/generate-release-notes.sh @@ -4,9 +4,6 @@ set -e version=$( cat version/version ) milestone=${version} -if [[ $RELEASE_TYPE = "RELEASE" ]]; then - milestone=${version%.RELEASE} -fi java -jar /github-release-notes-generator.jar \ --releasenotes.github.username=${GITHUB_USERNAME} \ diff --git a/gradle.properties b/gradle.properties index 238a9367ec..6a8280301c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=2.3.1.BUILD-SNAPSHOT +version=2.4.0-SNAPSHOT org.gradle.caching=true org.gradle.parallel=true