Perform build and distribute on CI.

See #21
This commit is contained in:
Mark Paluch
2023-01-09 11:05:39 +01:00
parent b2a2c7b000
commit aa5eff3d3f
7 changed files with 22 additions and 32 deletions

13
Jenkinsfile vendored
View File

@@ -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!")
}
}
}

View File

@@ -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"

View File

@@ -0,0 +1,3 @@
workspace cleanup
release build ${VERSION}
release distribute ${VERSION}

View File

@@ -1,2 +0,0 @@
github push ${VERSION}
release distribute ${VERSION}

View File

@@ -17,12 +17,13 @@ The <<build,*Build and publish the release*>> 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`

View File

@@ -241,7 +241,8 @@ class MavenBuildSystem implements BuildSystem {
public <M extends ProjectAware> 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);

View File

@@ -50,7 +50,7 @@ public class Project implements Comparable<Project> {
}
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",