diff --git a/Jenkinsfile b/Jenkinsfile index 96932ef..4447953 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,9 +59,9 @@ pipeline { steps { script { sh "ci/build-spring-data-release-cli.bash" - sh "ci/prepare-and-build.bash ${p['release.version']}" + // sh "ci/prepare-and-build.bash ${p['release.version']}" - slackSend( + /*slackSend( color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', channel: '#spring-data-dev', message: (currentBuild.currentResult == 'SUCCESS') @@ -69,16 +69,17 @@ pipeline { : "`${env.BUILD_URL}` - Push and distribute failed!") input("SMOKE TEST: Did the smoke tests for ${p['release.version']} pass? Accept to conclude and distribute the release.") + */ - sh "ci/conclude.bash ${p['release.version']}" - sh "ci/push-and-distribute.bash ${p['release.version']}" + // sh "ci/conclude.bash ${p['release.version']}" + sh "ci/build-and-distribute.bash ${p['release.version']}" slackSend( color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', channel: '#spring-data-dev', message: (currentBuild.currentResult == 'SUCCESS') - ? "`${env.BUILD_URL}` - Push and distribute ${p['release.version']} passed! Release the build (if needed)." - : "`${env.BUILD_URL}` - Push and distribute ${p['release.version']} failed!") + ? "`${env.BUILD_URL}` - Build and distribute ${p['release.version']} passed! Release the build (if needed)." + : "`${env.BUILD_URL}` - Build and distribute ${p['release.version']} failed!") } } } diff --git a/ci/push-and-distribute.bash b/ci/build-and-distribute.bash similarity index 95% rename from ci/push-and-distribute.bash rename to ci/build-and-distribute.bash index 7a2bc9e..39f4a03 100755 --- a/ci/push-and-distribute.bash +++ b/ci/build-and-distribute.bash @@ -3,7 +3,7 @@ set -euo pipefail VERSION=$1 -echo "You want me to push and distribute ${VERSION} ??" +echo "You want me to build and distribute ${VERSION} ?" export MAVEN_HOME="$HOME/.sdkman/candidates/maven/current" export JAVA_HOME="$HOME/.sdkman/candidates/java/current" diff --git a/ci/build-and-distribute.template b/ci/build-and-distribute.template new file mode 100755 index 0000000..56f5eeb --- /dev/null +++ b/ci/build-and-distribute.template @@ -0,0 +1,3 @@ +workspace cleanup +release build ${VERSION} +release distribute ${VERSION} diff --git a/ci/push-and-distribute.template b/ci/push-and-distribute.template deleted file mode 100755 index 31715ff..0000000 --- a/ci/push-and-distribute.template +++ /dev/null @@ -1,2 +0,0 @@ -github push ${VERSION} -release distribute ${VERSION} diff --git a/readme.adoc b/readme.adoc index 2ddfd44..34f4726 100644 --- a/readme.adoc +++ b/readme.adoc @@ -17,12 +17,13 @@ The <> phase is what's covered by the CI . Upgrade dependencies in Spring Data Build parent pom (mind minor/major version rules). . All release tickets are present (CLI: `$ tracker releasetickets $trainIteration`) . Review open tickets for release. -. Self-assign release tickets (CLI: `$ tracker prepare $trainIteration`) +. Self-assign release tickets (CLI: `$ tracker prepare $trainIteration`) . Announce release preparations to mailing list (https://groups.google.com/forum/#!forum/spring-data-dev) -. 🚥 Continue with `Build and publish the release` +. Create release tag, verify the release can be built, and publish tags (CLI: `$ prepare-it $trainIteration`) +. 🚥 Continue with `Build and distribute the release` [[build]] -=== 🌿 Build and publish the release +=== 🌿 Build and distribute the release [%header,cols="1,1"] |=== @@ -56,27 +57,12 @@ A job should have started. Click on the active job, and then click on *Open Blue |=== -After preparing and building (approx. 20 minutes), the Jenkins pipeline will pause, indicating it's time to smoke test the staged release, and put up a prompt: *Proceed* or *Abort*. - -🚨 If you click on *Proceed*, then it will continue on to the `release conclude`/`github push`/`release distribute` phase. - * For a Maven central release, go to https://s01.oss.sonatype.org/ and login. ** After logging in, you will find a closed Spring Data Release repository. ** Click the repository and then choose "Release". * For an artifactory release, the release will already have been staged and promoted, so there is nothing more to do. * 🚥 Continue with `Post-release tasks` -*Background* -==== -The first CI phase includes: `release prepare` and `release build` and may take twenty minutes or so. - -* For a maven central release, you can visit https://s01.oss.sonatype.org/, login, and inspect the staged Spring Data Release. All the Spring Data modules will inside one repository. -* For a milestone/RC release, you can visit https://repo.spring.io/. All the Spring Data modules will be there, each module a separate "build". - -At this point in time, we don't have official Spring Data Release smoke testing configured, so you can simply click *Proceed* if there were no issues. + -For milestone/RC releases, Spring Data Release tools automatically promotes them in Artifactory, so if you have to delete a build, you'll ALSO have to go and delete each module individually. -==== - [[post-release]] === 🍀 Post-Release tasks @@ -149,13 +135,14 @@ See `application-local.template` for details. |All release tickets are present |`$ tracker releasetickets $trainIteration` |Self-assign release tickets |`$ tracker prepare $trainIteration` -2+| *Release the binaries* +2+| *Prepare the release* | |`$ release prepare $trainIteration` -|Build the artefacts and push them to the appropriate maven repository |`$ release build $trainIteration` | |`$ release conclude $trainIteration` +2+| *Build the release* +|Build the artifacts from tag and push them to the appropriate maven repository |`$ release build $trainIteration` +|Distribute documentation and static resources from tag |`$ release distribute $trainIteration` |Push the created commits to GitHub |`$ github push $trainIteration` |Push new maintenance branches if the release version was a GA release (`X.Y.0` version) |`$ git push $trainIteration.next` -|Distribute documentation and static resources from tag |`$ release distribute $trainIteration` 2+| *Post-release tasks* |Close JIRA tickets and GitHub release tickets. |`$ tracker close $trainIteration` |Create new release versions and tickets for upcoming version |`$ tracker setup-next $trainIteration.next` diff --git a/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java b/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java index f2b380c..3bfe440 100644 --- a/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java +++ b/src/main/java/org/springframework/data/release/build/MavenBuildSystem.java @@ -241,7 +241,8 @@ class MavenBuildSystem implements BuildSystem { public M triggerBuild(M module) { CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.INSTALL)// - .andIf(module.getProject().skipTests(), SKIP_TESTS); + .and(profile("ci,release")).andIf(module.getProject().skipTests(), SKIP_TESTS) + .andIf(!ObjectUtils.isEmpty(properties.getSettingsXml()), settingsXml(properties.getSettingsXml())); mvn.execute(module.getProject(), arguments); diff --git a/src/main/java/org/springframework/data/release/model/Project.java b/src/main/java/org/springframework/data/release/model/Project.java index 8fb4c36..06f3c30 100644 --- a/src/main/java/org/springframework/data/release/model/Project.java +++ b/src/main/java/org/springframework/data/release/model/Project.java @@ -50,7 +50,7 @@ public class Project implements Comparable { } private Project(String key, String name, String fullName, Tracker tracker) { - this(new ProjectKey(key), name, fullName, Collections.emptySet(), tracker, ArtifactCoordinates.SPRING_DATA, false); + this(new ProjectKey(key), name, fullName, Collections.emptySet(), tracker, ArtifactCoordinates.SPRING_DATA, true); } @java.beans.ConstructorProperties({ "key", "name", "fullName", "dependencies", "tracker", "additionalArtifacts",