diff --git a/projects/spring-cloud/src/test/java/releaser/cloud/spring/meta/SpringMetaReleaseAcceptanceTests.java b/projects/spring-cloud/src/test/java/releaser/cloud/spring/meta/SpringMetaReleaseAcceptanceTests.java index f83808c4..0cf9d279 100644 --- a/projects/spring-cloud/src/test/java/releaser/cloud/spring/meta/SpringMetaReleaseAcceptanceTests.java +++ b/projects/spring-cloud/src/test/java/releaser/cloud/spring/meta/SpringMetaReleaseAcceptanceTests.java @@ -22,6 +22,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.function.Consumer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -37,6 +38,7 @@ import releaser.internal.project.Projects; import releaser.internal.sagan.SaganClient; import releaser.internal.sagan.SaganUpdater; +import releaser.internal.spring.ArgsBuilder; import releaser.internal.spring.Arguments; import releaser.internal.spring.SpringReleaser; import releaser.internal.tasks.ReleaseReleaserTask; @@ -86,6 +88,64 @@ public class SpringMetaReleaseAcceptanceTests extends AbstractSpringCloudMetaAcc @TempDir File tempDirAllTestSample; + private void should_perform_a_meta_release_of_sc_release_and_consul(File tempDirSpringCloudConsulOrigin, + File tempDirSpringCloudConsulProject, boolean dryRun, + Consumer stepAsserter, ArgsBuilder argsBuilder) throws Exception { + checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "2022.0.x"); + + run(defaultRunner(), + properties("debugx=true") + .properties("test.metarelease=true", "releaser.git.create-release-notes-for-milestone=false") + .properties(argsBuilder.build()), + context -> { + SpringReleaser releaser = context.getBean(SpringReleaser.class); + NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context + .getBean(NonAssertingTestProjectGitHandler.class); + SaganUpdater saganUpdater = context.getBean(SaganUpdater.class); + PostReleaseActions postReleaseActions = context.getBean(PostReleaseActions.class); + TestExecutionResultHandler testExecutionResultHandler = context + .getBean(TestExecutionResultHandler.class); + ReleaseBundleCreator creator = context.getBean(ReleaseBundleCreator.class); + + ExecutionResult result = releaser + .release(new OptionsBuilder().metaRelease(true).dryRun(dryRun).options()); + + // print results + testExecutionResultHandler.accept(result); + then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue(); + + then(result.isFailureOrUnstable()).isFalse(); + // consul, release + then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(2); + // don't want to verify the docs + stepAsserter.accept(nonAssertingTestProjectGitHandler); + ProjectVersion projectVersion = new ProjectVersion(tempDirSpringCloudConsulOrigin); + if (!dryRun && !projectVersion.isSnapshot()) { + thenSaganWasCalled(saganUpdater); + then(clonedProject(nonAssertingTestProjectGitHandler, "spring-cloud-consul-commercial") + .tagList().call()).extracting("name").contains("refs/tags/v4.0.2"); + thenRunUpdatedTestsWereCalled(postReleaseActions); + thenUpdateReleaseTrainDocsWasCalled(postReleaseActions); + BDDMockito.then(creator).should(times(1)) + .createReleaseTrainSourceBundle( + List.of(new ProjectVersion("spring-cloud-consul", "4.0.2"), + new ProjectVersion("spring-cloud-starter-build", "2022.0.4")), + "2022.0.4"); + BDDMockito.then(creator).should(times(1)).createReleaseBundle( + List.of("org/springframework/cloud/spring-cloud-consul*", + "org/springframework/cloud/spring-cloud-starter-consul*"), + "4.0.2", "TNZ-spring-cloud-consul-commercial"); + BDDMockito.then(creator).should(times(1)).distributeReleaseTrainSourceBundle("2022.0.4"); + // This should never be called when releasing a release train + // since + // distributing a release train source bundle + // will distribute individual project release bundles + verify(creator, never()).distributeReleaseBundle(anyString(), anyString(), anyString()); + } + + }); + } + @Test public void should_perform_a_meta_release_of_sc_release_and_consul(@TempDir File tempDirSpringCloudConsulOrigin, @TempDir File tempDirSpringCloudConsulProject) throws Exception { @@ -144,6 +204,63 @@ public void should_perform_a_meta_release_of_sc_release_and_consul(@TempDir File }); } + @Test + public void should_perform_a_meta_release_of_sc_release_and_consul_ga(@TempDir File tempDirSpringCloudConsulOrigin, + @TempDir File tempDirSpringCloudConsulProject) throws Exception { + File origin = cloneToTemporaryDirectory(tempDirSpringCloudConsulOrigin, + this.springCloudConsulCommercialProject); + assertThatClonedConsulProjectIsInSnapshots(origin); + File project = cloneToTemporaryDirectory(tempDirSpringCloudConsulProject, tmpFile("spring-cloud-consul")); + GitTestUtils.setOriginOnProjectToTmp(origin, project); + should_perform_a_meta_release_of_sc_release_and_consul(tempDirSpringCloudConsulOrigin, + tempDirSpringCloudConsulProject, false, this::thenAllStepsWereExecutedForEachProjectDuringGaRelease, + metaReleaseArgs(project, tempDirTestSamplesProject, tempDirReleaseTrainDocs, tempDirSpringCloud, + tempDirReleaseTrainWiki, tempDirAllTestSample).bomBranch("v2022.0.2") + .addFixedVersions(v2022_0_4()).distributeReleaseTrainSourceReleaseBundle(true) + .releaseTrainSourceReleaseBundle(true).projectReleaseBundle(true).commercial(true) + .mavenGaReleaseBuildCommand("echo '{{profiles}}' > /tmp/executed_ga_build")); + } + + @Test + public void should_perform_a_snapshot_meta_release_of_sc_release_and_consul_ga( + @TempDir File tempDirSpringCloudConsulOrigin, @TempDir File tempDirSpringCloudConsulProject) + throws Exception { + File origin = cloneToTemporaryDirectory(tempDirSpringCloudConsulOrigin, + this.springCloudConsulCommercialProject); + assertThatClonedConsulProjectIsInSnapshots(origin); + File project = cloneToTemporaryDirectory(tempDirSpringCloudConsulProject, tmpFile("spring-cloud-consul")); + GitTestUtils.setOriginOnProjectToTmp(origin, project); + should_perform_a_meta_release_of_sc_release_and_consul(tempDirSpringCloudConsulOrigin, + tempDirSpringCloudConsulProject, false, this::thenAllStepsWereExecutedForEachProject, + metaReleaseArgs(project, tempDirTestSamplesProject, tempDirReleaseTrainDocs, tempDirSpringCloud, + tempDirReleaseTrainWiki, tempDirAllTestSample).bomBranch("v2022.0.2") + .addFixedVersions(v2022_0_4_SNAPSHOT()).distributeReleaseTrainSourceReleaseBundle(true) + .releaseTrainSourceReleaseBundle(true).projectReleaseBundle(true).commercial(true) + .mavenGaReleaseBuildCommand("echo '{{profiles}}' > /tmp/executed_ga_build")); + } + + @Test + public void should_perform_a_dry_run_meta_release_of_sc_release_and_consul_ga( + @TempDir File tempDirSpringCloudConsulOrigin, @TempDir File tempDirSpringCloudConsulProject) + throws Exception { + File origin = cloneToTemporaryDirectory(tempDirSpringCloudConsulOrigin, + this.springCloudConsulCommercialProject); + assertThatClonedConsulProjectIsInSnapshots(origin); + File project = cloneToTemporaryDirectory(tempDirSpringCloudConsulProject, tmpFile("spring-cloud-consul")); + GitTestUtils.setOriginOnProjectToTmp(origin, project); + should_perform_a_meta_release_of_sc_release_and_consul(tempDirSpringCloudConsulOrigin, + tempDirSpringCloudConsulProject, true, this::thenAllDryRunStepsWereExecutedForEachProject, + metaReleaseArgs(project, tempDirTestSamplesProject, tempDirReleaseTrainDocs, tempDirSpringCloud, + tempDirReleaseTrainWiki, tempDirAllTestSample).bomBranch("v2022.0.2") + .addFixedVersions(v2022_0_4()).distributeReleaseTrainSourceReleaseBundle(true) + .releaseTrainSourceReleaseBundle(true).projectReleaseBundle(true).commercial(true) + // Because this is a dry run we should not run the GA + // release build command, + // thenAllDryRunStepsWereExecutedForEachProject verifies + // just the build command was run + .mavenGaReleaseBuildCommand("echo '{{profiles}}' > /tmp/executed_ga_build")); + } + @Test public void should_perform_a_meta_release_of_sc_release_and_consul_in_parallel( @TempDir File tempDirSpringCloudConsulOrigin, @TempDir File tempDirSpringCloudConsulProject) diff --git a/releaser-core/src/main/java/releaser/internal/Releaser.java b/releaser-core/src/main/java/releaser/internal/Releaser.java index 3dadae76..585fc430 100644 --- a/releaser-core/src/main/java/releaser/internal/Releaser.java +++ b/releaser-core/src/main/java/releaser/internal/Releaser.java @@ -123,8 +123,8 @@ private ExecutionResult updateProjectFromBom(File project, Projects versions, Pr } public ExecutionResult buildProject(ReleaserProperties properties, ProjectVersion originalVersion, - ProjectVersion versionFromBom) { - this.projectCommandExecutor.build(properties, originalVersion, versionFromBom); + ProjectVersion versionFromBom, boolean dryRun) { + this.projectCommandExecutor.build(properties, originalVersion, versionFromBom, dryRun); log.info("\nProject was successfully built"); return ExecutionResult.success(); } diff --git a/releaser-core/src/main/java/releaser/internal/ReleaserProperties.java b/releaser-core/src/main/java/releaser/internal/ReleaserProperties.java index c68f90e8..720dea71 100644 --- a/releaser-core/src/main/java/releaser/internal/ReleaserProperties.java +++ b/releaser-core/src/main/java/releaser/internal/ReleaserProperties.java @@ -236,6 +236,16 @@ public ReleaserProperties copy() { */ public interface Command { + /** + * @return build command + */ + String getGaReleaseBuildCommand(); + + /** + * @param buildCommand to set + */ + void setGaReleaseBuildCommand(String buildCommand); + /** * @return build command */ @@ -1037,6 +1047,14 @@ public static class Maven implements Serializable, Command { **/ private String buildCommand = "./mvnw clean install -B -Pdocs {{systemProps}}"; + /** + * Command to be executed during a dry run build. If present "{{version}}" will be + * replaced by the provided version. "{{nextVersion}}" with the bumped snapshot + * version and "{{oldVersion}}" with the version before version updating. By + * default the value is the same as null. + **/ + private String gaReleaseBuildCommand = null; + /** * Command to be executed to deploy a built project. If present "{{version}}" will * be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot @@ -1076,6 +1094,19 @@ public static class Maven implements Serializable, Command { */ private long waitTimeInMinutes = 20; + @Override + public String getGaReleaseBuildCommand() { + if (this.gaReleaseBuildCommand == null) { + return this.getBuildCommand(); + } + return this.gaReleaseBuildCommand; + } + + @Override + public void setGaReleaseBuildCommand(String buildCommand) { + this.gaReleaseBuildCommand = buildCommand; + } + @Override public String getBuildCommand() { return this.buildCommand; @@ -1146,8 +1177,9 @@ public void setSystemProperties(String systemProperties) { @Override public String toString() { - return "Maven{" + "buildCommand='" + this.buildCommand + '\'' + ", deployCommand='" + this.deployCommand - + '\'' + ", publishDocsCommand=" + this.publishDocsCommand + "generateReleaseTrainDocsCommand='" + return "Maven{" + "buildCommand='" + this.buildCommand + '\'' + ", dryRunBuildCommand='" + + this.gaReleaseBuildCommand + '\'' + ", deployCommand='" + this.deployCommand + '\'' + + ", publishDocsCommand=" + this.publishDocsCommand + "generateReleaseTrainDocsCommand='" + this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes=" + this.waitTimeInMinutes + '}'; } @@ -1168,6 +1200,14 @@ public static class Bash implements Serializable, Command { */ private String buildCommand = "echo \"{{systemProps}}\""; + /** + * Command to be executed to build the project during a GA release. If present + * "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with + * the bumped snapshot version and "{{oldVersion}}" with the version before + * version updating. By default the value is null. + */ + private String gaReleaseBuildCommand = null; + /** * Command to be executed to deploy a built project. If present "{{version}}" will * be replaced by the provided version. "{{nextVersion}}" with the bumped snapshot @@ -1207,6 +1247,19 @@ public static class Bash implements Serializable, Command { */ private long waitTimeInMinutes = 20; + @Override + public String getGaReleaseBuildCommand() { + if (this.gaReleaseBuildCommand == null) { + return this.getBuildCommand(); + } + return this.gaReleaseBuildCommand; + } + + @Override + public void setGaReleaseBuildCommand(String buildCommand) { + this.gaReleaseBuildCommand = buildCommand; + } + @Override public String getBuildCommand() { return this.buildCommand; @@ -1277,8 +1330,9 @@ public void setSystemProperties(String systemProperties) { @Override public String toString() { - return "Bash{" + "buildCommand='" + this.buildCommand + '\'' + ", deployCommand='" + this.deployCommand - + '\'' + ", publishDocsCommand=" + this.publishDocsCommand + "generateReleaseTrainDocsCommand='" + return "Bash{" + "buildCommand='" + this.buildCommand + '\'' + ", dryRunBuildCommand='" + + this.gaReleaseBuildCommand + '\'' + ", deployCommand='" + this.deployCommand + '\'' + + ", publishDocsCommand=" + this.publishDocsCommand + "generateReleaseTrainDocsCommand='" + this.generateReleaseTrainDocsCommand + '\'' + ", waitTimeInMinutes=" + this.waitTimeInMinutes + '}'; } @@ -1320,12 +1374,20 @@ public static class Gradle implements Serializable, Command { private List ignoredGradleRegex = new ArrayList<>(); /** - * Command to be executed to build the project If present "{{version}}" will be + * Command to be executed to build the project. If present "{{version}}" will be * replaced by the provided version. "{{nextVersion}}" with the bumped snapshot * version and "{{oldVersion}}" with the version before version updating. **/ private String buildCommand = "./gradlew clean build publishToMavenLocal --console=plain -PnextVersion={{nextVersion}} -PoldVersion={{oldVersion}} -PcurrentVersion={{version}} {{systemProps}}"; + /** + * Command to be executed to build the project during a dry run. If present + * "{{version}}" will be replaced by the provided version. "{{nextVersion}}" with + * the bumped snapshot version and "{{oldVersion}}" with the version before + * version updating. By default the value is null. + */ + private String gaReleaseBuildCommand = null; + /** * Command to be executed to deploy a built project. */ @@ -1359,6 +1421,19 @@ public static class Gradle implements Serializable, Command { */ private long waitTimeInMinutes = 20; + @Override + public String getGaReleaseBuildCommand() { + if (this.gaReleaseBuildCommand == null) { + return this.getBuildCommand(); + } + return this.gaReleaseBuildCommand; + } + + @Override + public void setGaReleaseBuildCommand(String buildCommand) { + this.gaReleaseBuildCommand = buildCommand; + } + @Override public String getBuildCommand() { return this.buildCommand; @@ -1448,7 +1523,8 @@ public String toString() { return new StringJoiner(", ", Gradle.class.getSimpleName() + "[", "]") .add("gradlePropsSubstitution=" + gradlePropsSubstitution) .add("ignoredGradleRegex=" + ignoredGradleRegex).add("buildCommand='" + buildCommand + "'") - .add("deployCommand='" + deployCommand + "'") + .add("dryRunBuildCommand='" + gaReleaseBuildCommand + "'") + .add("buildCommand='" + buildCommand + "'").add("deployCommand='" + deployCommand + "'") .add("deployGuidesCommand='" + deployGuidesCommand + "'") .add("publishDocsCommand=" + publishDocsCommand) .add("generateReleaseTrainDocsCommand='" + generateReleaseTrainDocsCommand + "'") diff --git a/releaser-core/src/main/java/releaser/internal/postrelease/PostReleaseActions.java b/releaser-core/src/main/java/releaser/internal/postrelease/PostReleaseActions.java index ef3ae466..d910374b 100644 --- a/releaser-core/src/main/java/releaser/internal/postrelease/PostReleaseActions.java +++ b/releaser-core/src/main/java/releaser/internal/postrelease/PostReleaseActions.java @@ -119,7 +119,7 @@ public ExecutionResult runUpdatedTests(Projects projects) { String releaseTrainVersion = projects.releaseTrain(projectProps).version; Projects newProjects = addVersionForTestsProject(projects, projectVersion, releaseTrainVersion); updateWithVersions(file, newProjects); - this.projectCommandExecutor.build(projectProps, projectVersion, projectVersion, file.getAbsolutePath()); + this.projectCommandExecutor.build(projectProps, projectVersion, projectVersion, file.getAbsolutePath(), false); return ExecutionResult.success(); } diff --git a/releaser-core/src/main/java/releaser/internal/project/ProjectCommandExecutor.java b/releaser-core/src/main/java/releaser/internal/project/ProjectCommandExecutor.java index 050600d5..b93b03df 100644 --- a/releaser-core/src/main/java/releaser/internal/project/ProjectCommandExecutor.java +++ b/releaser-core/src/main/java/releaser/internal/project/ProjectCommandExecutor.java @@ -54,7 +54,12 @@ public class ProjectCommandExecutor { public void build(ReleaserProperties properties, ProjectVersion originalVersion, ProjectVersion versionFromReleaseTrain) { - build(properties, originalVersion, versionFromReleaseTrain, properties.getWorkingDir()); + build(properties, originalVersion, versionFromReleaseTrain, properties.getWorkingDir(), false); + } + + public void build(ReleaserProperties properties, ProjectVersion originalVersion, + ProjectVersion versionFromReleaseTrain, boolean dryRyn) { + build(properties, originalVersion, versionFromReleaseTrain, properties.getWorkingDir(), dryRyn); } public String version(ReleaserProperties properties) { @@ -82,9 +87,19 @@ private String executeCommandWithOutput(ReleaserProperties properties, String co } public void build(ReleaserProperties properties, ProjectVersion originalVersion, - ProjectVersion versionFromReleaseTrain, String projectRoot) { + ProjectVersion versionFromReleaseTrain, String projectRoot, boolean dryRun) { try { - String command = new CommandPicker(properties, projectRoot).buildCommand(versionFromReleaseTrain); + CommandPicker commandPicker = new CommandPicker(properties, projectRoot); + boolean useGaReleaseBuildCommand = !dryRun && !versionFromReleaseTrain.isSnapshot(); + String command; + if (useGaReleaseBuildCommand) { + log.info( + "We are not doing a dry run and not releasing a snapshot so will use GA release build command"); + command = commandPicker.gaReleaseBuildCommand(versionFromReleaseTrain); + } + else { + command = commandPicker.buildCommand(versionFromReleaseTrain); + } String[] commands = replaceAllPlaceHolders(originalVersion, versionFromReleaseTrain, command).split(" "); runCommand(properties, projectRoot, commands); assertNoHtmlFilesInDocsContainUnresolvedTags(projectRoot); @@ -307,6 +322,17 @@ else if (projectType == ProjectType.MAVEN) { return bashCommandWithSystemProps(releaserProperties.getBash().getBuildCommand()); } + String gaReleaseBuildCommand(ProjectVersion version) { + log.info("Running GA release build command."); + if (projectType == ProjectType.GRADLE) { + return gradleCommandWithSystemProps(releaserProperties.getGradle().getGaReleaseBuildCommand()); + } + else if (projectType == ProjectType.MAVEN) { + return mavenCommandWithSystemProps(releaserProperties.getMaven().getGaReleaseBuildCommand(), version); + } + return bashCommandWithSystemProps(releaserProperties.getBash().getGaReleaseBuildCommand()); + } + String version() { // makes more sense to use PomReader if (projectType == ProjectType.GRADLE) { diff --git a/releaser-core/src/test/java/releaser/internal/project/ProjectCommandExecutorTests.java b/releaser-core/src/test/java/releaser/internal/project/ProjectCommandExecutorTests.java index 1745420b..60e131b3 100644 --- a/releaser-core/src/test/java/releaser/internal/project/ProjectCommandExecutorTests.java +++ b/releaser-core/src/test/java/releaser/internal/project/ProjectCommandExecutorTests.java @@ -86,7 +86,7 @@ public void should_successfully_execute_a_command_when_path_is_provided_explicit ProjectCommandExecutor builder = projectBuilder(properties); builder.build(properties, original(), new ProjectVersion("foo", "1.0.0.BUILD-SNAPSHOT"), - tmpFile("/builder/resolved").getPath()); + tmpFile("/builder/resolved").getPath(), false); then(asString(tmpFile("/builder/resolved/resolved.log"))).contains("resolved.log"); } diff --git a/releaser-spring/src/main/java/releaser/internal/tasks/release/BuildProjectReleaseTask.java b/releaser-spring/src/main/java/releaser/internal/tasks/release/BuildProjectReleaseTask.java index 719276f8..c966d5ab 100644 --- a/releaser-spring/src/main/java/releaser/internal/tasks/release/BuildProjectReleaseTask.java +++ b/releaser-spring/src/main/java/releaser/internal/tasks/release/BuildProjectReleaseTask.java @@ -61,7 +61,8 @@ public String description() { @Override public ExecutionResult runTask(Arguments args) { log.info("Arguments for this release task: " + args); - return this.releaser.buildProject(args.properties, args.originalVersion, args.versionFromBom); + return this.releaser.buildProject(args.properties, args.originalVersion, args.versionFromBom, + args.options.dryRun); } @Override diff --git a/releaser-test/src/main/java/releaser/internal/spring/AbstractSpringAcceptanceTests.java b/releaser-test/src/main/java/releaser/internal/spring/AbstractSpringAcceptanceTests.java index 05454ac2..972bb997 100644 --- a/releaser-test/src/main/java/releaser/internal/spring/AbstractSpringAcceptanceTests.java +++ b/releaser-test/src/main/java/releaser/internal/spring/AbstractSpringAcceptanceTests.java @@ -106,6 +106,7 @@ public void cleanup() throws Exception { public void clean() { new File("/tmp/executed_build").delete(); + new File("/tmp/executed_ga_build").delete(); new File("/tmp/executed_deploy").delete(); new File("/tmp/executed_docs").delete(); blogTemplate().delete(); diff --git a/releaser-test/src/main/java/releaser/internal/spring/ArgsBuilder.java b/releaser-test/src/main/java/releaser/internal/spring/ArgsBuilder.java index c0a2c89d..cced9895 100644 --- a/releaser-test/src/main/java/releaser/internal/spring/ArgsBuilder.java +++ b/releaser-test/src/main/java/releaser/internal/spring/ArgsBuilder.java @@ -115,6 +115,12 @@ public ArgsBuilder mavenBuildCommand(String command) throws Exception { return this; } + public ArgsBuilder mavenGaReleaseBuildCommand(String command) throws Exception { + removeIfPresent("releaser.maven.ga-release-build-command"); + this.args.add("releaser.maven.ga-release-build-command=" + command); + return this; + } + public ArgsBuilder mavenDeployCommand(String command) throws Exception { removeIfPresent("releaser.maven.deploy-command"); this.args.add("releaser.maven.deploy-command=" + command); diff --git a/releaser-test/src/main/java/releaser/internal/spring/meta/AbstractSpringMetaReleaseAcceptanceTests.java b/releaser-test/src/main/java/releaser/internal/spring/meta/AbstractSpringMetaReleaseAcceptanceTests.java index e94b1930..638251a7 100644 --- a/releaser-test/src/main/java/releaser/internal/spring/meta/AbstractSpringMetaReleaseAcceptanceTests.java +++ b/releaser-test/src/main/java/releaser/internal/spring/meta/AbstractSpringMetaReleaseAcceptanceTests.java @@ -100,6 +100,29 @@ public Map v2022_0_4() { return versions; } + public Map v2022_0_4_SNAPSHOT() { + Map versions = new LinkedHashMap<>(); + versions.put("spring-boot", "3.0.7-SNAPSHOT"); + versions.put("spring-cloud-build", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-function", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-stream", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-commons", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-bus", "4.0.1-SNAPSHOT"); + versions.put("spring-cloud-task", "3.0.3-SNAPSHOT"); + versions.put("spring-cloud-config", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-netflix", "4.0.2-SNAPSHOT"); + versions.put("spring-cloud-openfeign", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-consul", "4.0.2-SNAPSHOT"); + versions.put("spring-cloud-circuitbreaker", "3.0.2-SNAPSHOT"); + versions.put("spring-cloud-gateway", "4.0.6-SNAPSHOT"); + versions.put("spring-cloud-zookeeper", "4.0.0-SNAPSHOT"); + versions.put("spring-cloud-contract", "4.0.3-SNAPSHOT"); + versions.put("spring-cloud-kubernetes", "3.0.3-SNAPSHOT"); + versions.put("spring-cloud-vault", "4.0.1-SNAPSHOT"); + versions.put("spring-cloud-release", "2022.0.4-SNAPSHOT"); + return versions; + } + public void thenAllStepsWereExecutedForEachProject( NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler) { nonAssertingTestProjectGitHandler.clonedProjects.stream() @@ -112,6 +135,18 @@ public void thenAllStepsWereExecutedForEachProject( }); } + public void thenAllStepsWereExecutedForEachProjectDuringGaRelease( + NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler) { + nonAssertingTestProjectGitHandler.clonedProjects.stream() + .filter(f -> !f.getName().contains("angel") && !f.getName().equals("spring-cloud")).forEach(project -> { + then(Arrays.asList("spring-cloud-starter-build", "spring-cloud-consul")) + .contains(pom(project).getArtifactId()); + then(new File("/tmp/executed_ga_build")).exists(); + then(new File("/tmp/executed_deploy")).exists(); + then(new File("/tmp/executed_docs")).exists(); + }); + } + public void thenSaganWasCalled(SaganUpdater saganUpdater) { BDDMockito.then(saganUpdater).should(BDDMockito.atLeastOnce()).updateSagan(BDDMockito.any(File.class), BDDMockito.anyString(), BDDMockito.any(ProjectVersion.class), BDDMockito.any(ProjectVersion.class),