Browse Source

Start work on Spring Boot 2.4

pull/21612/head
Andy Wilkinson 6 years ago
parent
commit
8e8548756e
  1. 5
      buildSrc/src/main/java/org/springframework/boot/build/artifactory/ArtifactoryRepository.java
  2. 10
      buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java
  3. 2
      ci/README.adoc
  4. 2
      ci/images/setup.sh
  5. 2
      ci/parameters.yml
  6. 6
      ci/pipeline.yml
  7. 3
      ci/scripts/generate-release-notes.sh
  8. 2
      gradle.properties

5
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) { private static String determineArtifactoryRepo(Project project) {
String version = project.getVersion().toString(); String version = project.getVersion().toString();
String type = version.substring(version.lastIndexOf('.') + 1); int modifierIndex = version.lastIndexOf('-');
if (type.equals("RELEASE")) { if (modifierIndex == -1) {
return "release"; return "release";
} }
String type = version.substring(modifierIndex + 1);
if (type.startsWith("M") || type.startsWith("RC")) { if (type.startsWith("M") || type.startsWith("RC")) {
return "milestone"; return "milestone";
} }

10
buildSrc/src/test/java/org/springframework/boot/build/artifactory/ArtifactoryRepositoryTests.java

@ -32,28 +32,28 @@ public class ArtifactoryRepositoryTests {
@Test @Test
void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() { void whenProjectVersionIsMilestoneThenRepositoryIsMilestone() {
Project project = ProjectBuilder.builder().build(); Project project = ProjectBuilder.builder().build();
project.setVersion("1.2.3.M1"); project.setVersion("1.2.3-M1");
assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone");
} }
@Test @Test
void whenProjectVersionIsReleaseCandidateThenRepositoryIsMilestone() { void whenProjectVersionIsReleaseCandidateThenRepositoryIsMilestone() {
Project project = ProjectBuilder.builder().build(); Project project = ProjectBuilder.builder().build();
project.setVersion("1.2.3.RC1"); project.setVersion("1.2.3-RC1");
assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("milestone");
} }
@Test @Test
void whenProjectVersionIsReleaseThenRepositoryIsRelease() { void whenProjectVersionIsReleaseThenRepositoryIsRelease() {
Project project = ProjectBuilder.builder().build(); Project project = ProjectBuilder.builder().build();
project.setVersion("1.2.3.RELEASE"); project.setVersion("1.2.3");
assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("release"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("release");
} }
@Test @Test
void whenProjectVersionIsBuildSnapshotThenRepositoryIsSnapshot() { void whenProjectVersionIsSnapshotThenRepositoryIsSnapshot() {
Project project = ProjectBuilder.builder().build(); 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"); assertThat(ArtifactoryRepository.forProject(project).getName()).isEqualTo("snapshot");
} }

2
ci/README.adoc

@ -11,7 +11,7 @@ The pipeline can be deployed using the following command:
[source] [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 NOTE: This assumes that you have credhub integration configured with the appropriate

2
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 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/* 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
########################################################### ###########################################################

2
ci/parameters.yml

@ -6,7 +6,7 @@ github-repo-name: "spring-projects/spring-boot"
docker-hub-organization: "springci" docker-hub-organization: "springci"
artifactory-server: "https://repo.spring.io" artifactory-server: "https://repo.spring.io"
branch: "master" branch: "master"
milestone: "2.3.x" milestone: "2.4.x"
build-name: "spring-boot" build-name: "spring-boot"
pipeline-name: "spring-boot" pipeline-name: "spring-boot"
concourse-url: "https://ci.spring.io" concourse-url: "https://ci.spring.io"

6
ci/pipeline.yml

@ -77,7 +77,7 @@ resources:
repository: ((docker-hub-organization))/spring-boot-ci-image repository: ((docker-hub-organization))/spring-boot-ci-image
username: ((docker-hub-username)) username: ((docker-hub-username))
password: ((docker-hub-password)) password: ((docker-hub-password))
tag: 2.3.x tag: 2.4.x
- name: spring-boot-jdk11-ci-image - name: spring-boot-jdk11-ci-image
type: docker-image type: docker-image
icon: docker icon: docker
@ -85,7 +85,7 @@ resources:
repository: ((docker-hub-organization))/spring-boot-jdk11-ci-image repository: ((docker-hub-organization))/spring-boot-jdk11-ci-image
username: ((docker-hub-username)) username: ((docker-hub-username))
password: ((docker-hub-password)) password: ((docker-hub-password))
tag: 2.3.x tag: 2.4.x
- name: spring-boot-jdk14-ci-image - name: spring-boot-jdk14-ci-image
type: docker-image type: docker-image
icon: docker icon: docker
@ -93,7 +93,7 @@ resources:
repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image repository: ((docker-hub-organization))/spring-boot-jdk14-ci-image
username: ((docker-hub-username)) username: ((docker-hub-username))
password: ((docker-hub-password)) password: ((docker-hub-password))
tag: 2.3.x tag: 2.4.x
- name: artifactory-repo - name: artifactory-repo
type: artifactory-resource type: artifactory-resource
icon: package-variant icon: package-variant

3
ci/scripts/generate-release-notes.sh

@ -4,9 +4,6 @@ set -e
version=$( cat version/version ) version=$( cat version/version )
milestone=${version} milestone=${version}
if [[ $RELEASE_TYPE = "RELEASE" ]]; then
milestone=${version%.RELEASE}
fi
java -jar /github-release-notes-generator.jar \ java -jar /github-release-notes-generator.jar \
--releasenotes.github.username=${GITHUB_USERNAME} \ --releasenotes.github.username=${GITHUB_USERNAME} \

2
gradle.properties

@ -1,4 +1,4 @@
version=2.3.1.BUILD-SNAPSHOT version=2.4.0-SNAPSHOT
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

Loading…
Cancel
Save