Skip to content

Commit 1e7cb5d

Browse files
committed
Add spring-enterprise profile to commercial builds.
1 parent 3442031 commit 1e7cb5d

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

ci/build-and-distribute.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
workspace cleanup
22
git update ${VERSION}
33
release build ${VERSION}
4+
artifactory release create ${VERSION}
45
release distribute ${VERSION}
56
quit

src/main/java/org/springframework/data/release/build/MavenBuildSystem.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,20 @@ public ModuleIteration prepareVersion(ModuleIteration module, Phase phase) {
182182
if (BOM.equals(module.getProject())) {
183183

184184
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
185-
.and(arg("generateBackupPoms").withValue("false")));
185+
.and(arg("generateBackupPoms").withValue("false")) //
186+
.andIf(module.isCommercial(), profile("spring-enterprise")));
186187

187188
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
188189
.and(arg("generateBackupPoms").withValue("false")) //
189190
.and(arg("processAllModules").withValue("true")) //
190-
.and(Argument.of("-pl").withValue("bom")));
191+
.and(Argument.of("-pl").withValue("bom")) //
192+
.andIf(module.isCommercial(), profile("spring-enterprise")));
191193

192194
} else {
193195
mvn.execute(project,
194196
goals.and(arg("newVersion").withValue(information.getProjectVersionToSet(project.getProject())))
195-
.and(arg("generateBackupPoms").withValue("false")));
197+
.and(arg("generateBackupPoms").withValue("false")) //
198+
.andIf(module.isCommercial(), profile("spring-enterprise")));
196199
}
197200

198201
if (BUILD.equals(module.getProject())) {
@@ -201,10 +204,11 @@ public ModuleIteration prepareVersion(ModuleIteration module, Phase phase) {
201204
mvn.execute(project, goals.and(arg("newVersion").withValue(information.getReleaseTrainVersion())) //
202205
.and(arg("generateBackupPoms").withValue("false")) //
203206
.and(arg("groupId").withValue("org.springframework.data")) //
204-
.and(arg("artifactId").withValue("spring-data-releasetrain")));
207+
.and(arg("artifactId").withValue("spring-data-releasetrain")) //
208+
.andIf(module.isCommercial(), profile("spring-enterprise")));
205209
}
206210

207-
mvn.execute(project, CommandLine.of(Goal.INSTALL));
211+
mvn.execute(project, CommandLine.of(Goal.INSTALL).andIf(module.isCommercial(), profile("spring-enterprise")));
208212
}
209213

210214
return module;
@@ -277,8 +281,9 @@ public void close(Train train, StagingRepository stagingRepository) {
277281
@Override
278282
public <M extends ProjectAware> M triggerBuild(M module) {
279283

284+
Argument profile = module.isCommercial() ? profile("ci,release,spring-enterprise") : profile("ci,release");
280285
CommandLine arguments = CommandLine.of(Goal.CLEAN, Goal.INSTALL, //
281-
profile("ci,release"), //
286+
profile, //
282287
arg("gpg.executable").withValue(gpg.getExecutable()), //
283288
arg("gpg.keyname").withValue(gpg.getKeyname()), //
284289
arg("gpg.passphrase").withValue(gpg.getPassphrase()))//

src/main/java/org/springframework/data/release/deployment/ArtifactoryCommands.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.springframework.data.release.model.ModuleIteration;
2727
import org.springframework.data.release.model.SupportStatus;
2828
import org.springframework.data.release.model.TrainIteration;
29+
import org.springframework.data.release.utils.Logger;
2930
import org.springframework.shell.core.annotation.CliCommand;
3031
import org.springframework.shell.core.annotation.CliOption;
3132

@@ -40,6 +41,7 @@ class ArtifactoryCommands extends TimedCommand {
4041

4142
private final @NonNull DeploymentOperations deployment;
4243
private final @NonNull ArtifactoryOperations operations;
44+
private final @NonNull Logger log;
4345

4446
@CliCommand(value = "artifactory verify", help = "Verifies authentication at Artifactory.")
4547
public void verify() {
@@ -51,17 +53,23 @@ public void verify() {
5153
@SneakyThrows
5254
public void createArtifactoryReleases(@CliOption(key = "", mandatory = true) TrainIteration trainIteration) {
5355

54-
for (ModuleIteration moduleIteration : trainIteration) {
55-
operations.createArtifactoryRelease(moduleIteration);
56-
}
56+
if (trainIteration.isCommercial()) {
57+
58+
log.log(trainIteration, "Creating Artifactory Release bundle");
59+
60+
for (ModuleIteration moduleIteration : trainIteration) {
61+
operations.createArtifactoryRelease(moduleIteration);
62+
}
5763

58-
// aggregator creation requires a bit of time
64+
// aggregator creation requires a bit of time
5965
// otherwise we will see 16:19:04 "message" : "Release Bundle path not found:
6066
// spring-release-bundles-v2/TNZ-spring-data-rest-commercial/4.0.15/release-bundle.json.evd"
6167
Thread.sleep(2000);
6268

6369
operations.createArtifactoryReleaseAggregator(trainIteration);
64-
70+
} else {
71+
log.log(trainIteration, "Skipping Artifactory Release bundle creation, not a commercial release");
72+
}
6573
}
6674

6775
@CliCommand(value = "artifactory release distribute")

0 commit comments

Comments
 (0)