Add spring-enterprise profile to commercial builds.

This commit is contained in:
Mark Paluch
2025-02-14 15:59:16 +01:00
parent 34420310f3
commit 1e7cb5d7f2
3 changed files with 25 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
workspace cleanup
git update ${VERSION}
release build ${VERSION}
artifactory release create ${VERSION}
release distribute ${VERSION}
quit

View File

@@ -182,17 +182,20 @@ class MavenBuildSystem implements BuildSystem {
if (BOM.equals(module.getProject())) {
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
.and(arg("generateBackupPoms").withValue("false")));
.and(arg("generateBackupPoms").withValue("false")) //
.andIf(module.isCommercial(), profile("spring-enterprise")));
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
.and(arg("generateBackupPoms").withValue("false")) //
.and(arg("processAllModules").withValue("true")) //
.and(Argument.of("-pl").withValue("bom")));
.and(Argument.of("-pl").withValue("bom")) //
.andIf(module.isCommercial(), profile("spring-enterprise")));
} else {
mvn.execute(project,
goals.and(arg("newVersion").withValue(information.getProjectVersionToSet(project.getProject())))
.and(arg("generateBackupPoms").withValue("false")));
.and(arg("generateBackupPoms").withValue("false")) //
.andIf(module.isCommercial(), profile("spring-enterprise")));
}
if (BUILD.equals(module.getProject())) {
@@ -201,10 +204,11 @@ class MavenBuildSystem implements BuildSystem {
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
.and(arg("generateBackupPoms").withValue("false")) //
.and(arg("groupId").withValue("org.springframework.data")) //
.and(arg("artifactId").withValue("spring-data-releasetrain")));
.and(arg("artifactId").withValue("spring-data-releasetrain")) //
.andIf(module.isCommercial(), profile("spring-enterprise")));
}
mvn.execute(project, CommandLine.of(Goal.INSTALL));
mvn.execute(project, CommandLine.of(Goal.INSTALL).andIf(module.isCommercial(), profile("spring-enterprise")));
}
return module;
@@ -277,8 +281,9 @@ class MavenBuildSystem implements BuildSystem {
@Override
public <M extends ProjectAware> M triggerBuild(M module) {
Argument profile = module.isCommercial() ? profile("ci,release,spring-enterprise") : profile("ci,release");
CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.INSTALL, //
profile("ci,release"), //
profile, //
arg("gpg.executable").withValue(gpg.getExecutable()), //
arg("gpg.keyname").withValue(gpg.getKeyname()), //
arg("gpg.passphrase").withValue(gpg.getPassphrase()))//

View File

@@ -26,6 +26,7 @@ import org.springframework.data.release.TimedCommand;
import org.springframework.data.release.model.ModuleIteration;
import org.springframework.data.release.model.SupportStatus;
import org.springframework.data.release.model.TrainIteration;
import org.springframework.data.release.utils.Logger;
import org.springframework.shell.core.annotation.CliCommand;
import org.springframework.shell.core.annotation.CliOption;
@@ -40,6 +41,7 @@ class ArtifactoryCommands extends TimedCommand {
private final @NonNull DeploymentOperations deployment;
private final @NonNull ArtifactoryOperations operations;
private final @NonNull Logger log;
@CliCommand(value = "artifactory verify", help = "Verifies authentication at Artifactory.")
public void verify() {
@@ -51,17 +53,23 @@ class ArtifactoryCommands extends TimedCommand {
@SneakyThrows
public void createArtifactoryReleases(@CliOption(key = "", mandatory = true) TrainIteration trainIteration) {
for (ModuleIteration moduleIteration : trainIteration) {
operations.createArtifactoryRelease(moduleIteration);
}
if (trainIteration.isCommercial()) {
// aggregator creation requires a bit of time
log.log(trainIteration, "Creating Artifactory Release bundle");
for (ModuleIteration moduleIteration : trainIteration) {
operations.createArtifactoryRelease(moduleIteration);
}
// aggregator creation requires a bit of time
// otherwise we will see 16:19:04 "message" : "Release Bundle path not found:
// spring-release-bundles-v2/TNZ-spring-data-rest-commercial/4.0.15/release-bundle.json.evd"
Thread.sleep(2000);
operations.createArtifactoryReleaseAggregator(trainIteration);
} else {
log.log(trainIteration, "Skipping Artifactory Release bundle creation, not a commercial release");
}
}
@CliCommand(value = "artifactory release distribute")