Fixed
- not breaking the build when a release task has failed - added skipped state of task
This commit is contained in:
@@ -20,9 +20,9 @@ import org.cloudfoundry.operations.CloudFoundryOperations;
|
||||
import org.cloudfoundry.operations.applications.RestartApplicationRequest;
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.DryRunReleaseReleaserTask;
|
||||
import releaser.internal.tasks.release.PublishDocsReleaseTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class RestartSiteProjectPostReleaseTask extends PublishDocsReleaseTask
|
||||
implements DryRunReleaseReleaserTask {
|
||||
|
||||
@@ -26,9 +26,9 @@ import releaser.internal.options.Options;
|
||||
import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.ProjectToRun;
|
||||
import releaser.internal.spring.ProjectsFromBom;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
||||
@@ -35,9 +35,14 @@ import releaser.internal.postrelease.PostReleaseActions;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.sagan.SaganClient;
|
||||
import releaser.internal.sagan.SaganUpdater;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.SpringReleaser;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tasks.composite.MetaReleaseCompositeTask;
|
||||
import releaser.internal.tasks.composite.ReleaseCompositeTask;
|
||||
import releaser.internal.tasks.release.BuildProjectReleaseTask;
|
||||
import releaser.internal.tech.BuildUnstableException;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
import releaser.internal.template.TemplateGenerator;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -46,6 +51,7 @@ import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -61,11 +67,6 @@ import static org.mockito.ArgumentMatchers.argThat;
|
||||
public class SpringMetaReleaseAcceptanceTests
|
||||
extends AbstractSpringCloudMetaAcceptanceTests {
|
||||
|
||||
SpringApplicationBuilder runner = new SpringApplicationBuilder(
|
||||
SpringMetaReleaseAcceptanceTests.MetaReleaseConfig.class,
|
||||
SpringMetaReleaseAcceptanceTests.MetaReleaseScanningConfiguration.class)
|
||||
.web(WebApplicationType.NONE).properties("spring.jmx.enabled=false");
|
||||
|
||||
@Test
|
||||
public void should_perform_a_meta_release_of_sc_release_and_consul()
|
||||
throws Exception {
|
||||
@@ -75,7 +76,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
|
||||
run(this.runner,
|
||||
run(defaultRunner(),
|
||||
properties("debug=true").properties("test.metarelease=true")
|
||||
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
|
||||
.addFixedVersions(edgwareSr10()).build()),
|
||||
@@ -94,6 +95,10 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
ExecutionResult result = releaser
|
||||
.release(new OptionsBuilder().metaRelease(true).options());
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
// consul, release, documentation
|
||||
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(3);
|
||||
@@ -107,10 +112,6 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
.contains("refs/tags/v5.3.5.RELEASE");
|
||||
thenRunUpdatedTestsWereCalled(postReleaseActions);
|
||||
thenUpdateReleaseTrainDocsWasCalled(postReleaseActions);
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -123,7 +124,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
|
||||
run(this.runner, properties("debug=true").properties("test.metarelease=true")
|
||||
run(defaultRunner(), properties("debug=true").properties("test.metarelease=true")
|
||||
.properties(metaReleaseArgsForParallel(project)
|
||||
.bomBranch("vGreenwich.SR2").addFixedVersions(edgwareSr10())
|
||||
.metaReleaseGroups("example1,example2",
|
||||
@@ -174,7 +175,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
|
||||
run(this.runner,
|
||||
run(defaultRunner(),
|
||||
properties("debug=true").properties("test.metarelease=true")
|
||||
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
|
||||
.addFixedVersions(edgwareSr10()).build()),
|
||||
@@ -193,6 +194,10 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
ExecutionResult result = releaser.release(new OptionsBuilder()
|
||||
.metaRelease(true).dryRun(true).options());
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
// consul, release
|
||||
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(2);
|
||||
@@ -206,10 +211,6 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
.doesNotContain("refs/tags/v5.3.5.RELEASE");
|
||||
thenRunUpdatedTestsWereNotCalled(postReleaseActions);
|
||||
thenUpdateReleaseTrainDocsWasNotCalled(postReleaseActions);
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -223,7 +224,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
File temporaryDestination = this.tmp.newFolder();
|
||||
|
||||
run(this.runner,
|
||||
run(defaultRunner(),
|
||||
properties("debug=true")
|
||||
.properties("test.metarelease=true", "test.mockBuild=true")
|
||||
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
|
||||
@@ -241,13 +242,13 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
ExecutionResult result = releaser
|
||||
.release(new OptionsBuilder().metaRelease(true).options());
|
||||
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
thenBuildWasNeverCalledFor(build, "spring-cloud-consul");
|
||||
thenBuildWasCalledFor(build, "spring-cloud-release");
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
thenBuildWasNeverCalledFor(build, "spring-cloud-consul");
|
||||
thenBuildWasCalledFor(build, "spring-cloud-release");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
File temporaryDestination = this.tmp.newFolder();
|
||||
|
||||
run(this.runner,
|
||||
run(defaultRunner(),
|
||||
properties("debug=true")
|
||||
.properties("test.metarelease=true", "test.mockBuild=true")
|
||||
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
|
||||
@@ -281,6 +282,10 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
.release(new OptionsBuilder().startFrom("spring-cloud-consul")
|
||||
.metaRelease(true).options());
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
|
||||
// release
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
thenBuildWasNeverCalledFor(build, "spring-cloud-build");
|
||||
@@ -291,10 +296,6 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
thenSaganWasCalled(saganUpdater);
|
||||
thenDocumentationWasUpdated(testDocumentationUpdater);
|
||||
thenWikiPageWasUpdated(testDocumentationUpdater);
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -308,7 +309,7 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
File temporaryDestination = this.tmp.newFolder();
|
||||
|
||||
run(this.runner,
|
||||
run(defaultRunner(),
|
||||
properties("debug=true")
|
||||
.properties("test.metarelease=true", "test.mockBuild=true")
|
||||
.properties(metaReleaseArgs(project).bomBranch("Greenwich")
|
||||
@@ -328,6 +329,10 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
.taskNames(Collections.singletonList("spring-cloud-consul"))
|
||||
.metaRelease(true).options());
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
|
||||
// release
|
||||
then(result.isFailureOrUnstable()).isFalse();
|
||||
thenBuildWasNeverCalledFor(build, "spring-cloud-release");
|
||||
@@ -338,13 +343,66 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
thenSaganWasCalled(saganUpdater);
|
||||
thenDocumentationWasUpdated(testDocumentationUpdater);
|
||||
thenWikiPageWasUpdated(testDocumentationUpdater);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_not_execute_any_subsequent_task_when_first_one_fails()
|
||||
throws Exception {
|
||||
checkoutReleaseTrainBranch("/projects/spring-cloud-release/", "Greenwich");
|
||||
File origin = cloneToTemporaryDirectory(this.springCloudConsulProject);
|
||||
assertThatClonedConsulProjectIsInSnapshots(origin);
|
||||
File project = cloneToTemporaryDirectory(tmpFile("spring-cloud-consul"));
|
||||
GitTestUtils.setOriginOnProjectToTmp(origin, project);
|
||||
|
||||
run(failingBuildRunner(), properties("debug=true")
|
||||
.properties("test.metarelease=true", "test.metarelease.failing=true",
|
||||
"releaser.flow.default-enabled=false")
|
||||
.properties(metaReleaseArgs(project).bomBranch("vGreenwich.SR2")
|
||||
.addFixedVersions(edgwareSr10()).build()),
|
||||
context -> {
|
||||
SpringReleaser releaser = context.getBean(SpringReleaser.class);
|
||||
NonAssertingTestProjectGitHandler nonAssertingTestProjectGitHandler = context
|
||||
.getBean(NonAssertingTestProjectGitHandler.class);
|
||||
TestExecutionResultHandler testExecutionResultHandler = context
|
||||
.getBean(TestExecutionResultHandler.class);
|
||||
FirstTask firstTask = context.getBean(FirstTask.class);
|
||||
SecondTask secondTask = context.getBean(SecondTask.class);
|
||||
|
||||
ExecutionResult result = releaser
|
||||
.release(new OptionsBuilder().metaRelease(true).options());
|
||||
|
||||
// print results
|
||||
testExecutionResultHandler.accept(result);
|
||||
then(testExecutionResultHandler.exitedSuccessOrUnstable).isTrue();
|
||||
then(testExecutionResultHandler.exitedWithException).isTrue();
|
||||
|
||||
then(result.isFailureOrUnstable()).isTrue();
|
||||
// consul
|
||||
then(nonAssertingTestProjectGitHandler.clonedProjects).hasSize(1);
|
||||
BDDMockito.then(firstTask).should().runTask(BDDMockito.argThat(
|
||||
arg -> arg.project.getName().equals("spring-cloud-consul")));
|
||||
BDDMockito.then(firstTask).should(BDDMockito.never())
|
||||
.runTask(BDDMockito.argThat(arg -> arg.project.getName()
|
||||
.equals("spring-cloud-release")));
|
||||
BDDMockito.then(secondTask).should(BDDMockito.never())
|
||||
.runTask(BDDMockito.any(Arguments.class));
|
||||
});
|
||||
}
|
||||
|
||||
private SpringApplicationBuilder defaultRunner() {
|
||||
return new SpringApplicationBuilder(MetaReleaseConfig.class,
|
||||
MetaReleaseScanningConfiguration.class).web(WebApplicationType.NONE)
|
||||
.properties("spring.jmx.enabled=false");
|
||||
}
|
||||
|
||||
private SpringApplicationBuilder failingBuildRunner() {
|
||||
return new SpringApplicationBuilder(
|
||||
SpringMetaReleaseAcceptanceTests.MetaReleaseConfig.class,
|
||||
SpringMetaReleaseAcceptanceTests.MetaReleaseFailingTasksScanningConfiguration.class)
|
||||
.web(WebApplicationType.NONE)
|
||||
.properties("spring.jmx.enabled=false");
|
||||
}
|
||||
|
||||
private void thenWikiPageWasUpdated(DocumentationUpdater documentationUpdater) {
|
||||
BDDMockito.then(documentationUpdater).should()
|
||||
.updateReleaseTrainWiki(BDDMockito.any(Projects.class));
|
||||
@@ -406,7 +464,11 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
|
||||
@Bean
|
||||
PostReleaseActions myPostReleaseActions() {
|
||||
return BDDMockito.mock(PostReleaseActions.class);
|
||||
return BDDMockito
|
||||
.mock(PostReleaseActions.class,
|
||||
invocation -> invocation.getMethod().getReturnType()
|
||||
.equals(ExecutionResult.class)
|
||||
? ExecutionResult.success() : null);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -444,4 +506,101 @@ public class SpringMetaReleaseAcceptanceTests
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(value = "test.metarelease.failing", havingValue = "true")
|
||||
@ComponentScan({ "releaser.internal", "releaser.cloud" })
|
||||
static class MetaReleaseFailingTasksScanningConfiguration {
|
||||
|
||||
@Bean
|
||||
FirstTask firstTask() {
|
||||
return BDDMockito.spy(new FirstTask());
|
||||
}
|
||||
|
||||
@Bean
|
||||
SecondTask secondTask() {
|
||||
return BDDMockito.spy(new SecondTask());
|
||||
}
|
||||
|
||||
@Bean
|
||||
MetaReleaseCompositeTask metaReleaseCompositeTask(ApplicationContext context) {
|
||||
return new MetaReleaseCompositeTask(context);
|
||||
}
|
||||
|
||||
@Bean
|
||||
ReleaseCompositeTask releaseCompositeTask(ApplicationContext context) {
|
||||
return new ReleaseCompositeTask(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FirstTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "first";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String shortName() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String header() {
|
||||
return "FIRST";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args)
|
||||
throws BuildUnstableException, RuntimeException {
|
||||
return ExecutionResult.failure(new IllegalStateException("Failure"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SecondTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "second";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String shortName() {
|
||||
return "2";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String header() {
|
||||
return "SECOND";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args)
|
||||
throws BuildUnstableException, RuntimeException {
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.sagan.SaganClient;
|
||||
import releaser.internal.spring.ArgsBuilder;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.SpringReleaser;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
import releaser.internal.template.TemplateGenerator;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -33,6 +33,7 @@ import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.sagan.SaganUpdater;
|
||||
import releaser.internal.tech.BuildUnstableException;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
import releaser.internal.template.TemplateGenerator;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
@@ -100,12 +101,12 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
return this.projectPomUpdater.fixedVersions();
|
||||
}
|
||||
|
||||
public void updateProjectFromBom(File project, Projects versions,
|
||||
public ExecutionResult updateProjectFromBom(File project, Projects versions,
|
||||
ProjectVersion versionFromBom) {
|
||||
updateProjectFromBom(project, versions, versionFromBom, ASSERT_SNAPSHOTS);
|
||||
return updateProjectFromBom(project, versions, versionFromBom, ASSERT_SNAPSHOTS);
|
||||
}
|
||||
|
||||
private void updateProjectFromBom(File project, Projects versions,
|
||||
private ExecutionResult updateProjectFromBom(File project, Projects versions,
|
||||
ProjectVersion versionFromBom, boolean assertSnapshots) {
|
||||
log.info("Will update the project with versions [{}]", versions);
|
||||
this.projectPomUpdater.updateProjectFromReleaseTrain(project, versions,
|
||||
@@ -114,35 +115,42 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
versionFromBom, assertSnapshots);
|
||||
ProjectVersion changedVersion = new ProjectVersion(project);
|
||||
log.info("\n\nProject was successfully updated to [{}]", changedVersion.version);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void buildProject(ProjectVersion originalVersion,
|
||||
public ExecutionResult buildProject(ProjectVersion originalVersion,
|
||||
ProjectVersion versionFromBom) {
|
||||
this.projectCommandExecutor.build(originalVersion, versionFromBom);
|
||||
log.info("\nProject was successfully built");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void commitAndPushTags(File project, ProjectVersion changedVersion) {
|
||||
public ExecutionResult commitAndPushTags(File project,
|
||||
ProjectVersion changedVersion) {
|
||||
this.projectGitHandler.commitAndTagIfApplicable(project, changedVersion);
|
||||
log.info("\nCommit was made and tag was pushed successfully");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void deploy(ProjectVersion originalVersion, ProjectVersion versionFromBom) {
|
||||
public ExecutionResult deploy(ProjectVersion originalVersion,
|
||||
ProjectVersion versionFromBom) {
|
||||
this.projectCommandExecutor.deploy(originalVersion, versionFromBom);
|
||||
log.info("\nThe artifact was deployed successfully");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void publishDocs(ProjectVersion originalVersion,
|
||||
public ExecutionResult publishDocs(ProjectVersion originalVersion,
|
||||
ProjectVersion changedVersion) {
|
||||
this.projectCommandExecutor.publishDocs(originalVersion, changedVersion);
|
||||
log.info("\nThe docs were published successfully");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void rollbackReleaseVersion(File project, Projects projects,
|
||||
public ExecutionResult rollbackReleaseVersion(File project, Projects projects,
|
||||
ProjectVersion scReleaseVersion) {
|
||||
if (scReleaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't rollback a snapshot version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
this.projectGitHandler.revertChangesIfApplicable(project, scReleaseVersion);
|
||||
ProjectVersion originalVersion = originalVersion(project);
|
||||
@@ -155,9 +163,10 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
log.info(
|
||||
"\nSuccessfully reverted the commit and came back to snapshot versions");
|
||||
}
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private void updateBumpedVersions(File project, Projects projects,
|
||||
private ExecutionResult updateBumpedVersions(File project, Projects projects,
|
||||
ProjectVersion originalVersion) {
|
||||
Projects newProjects = Projects.forRollback(releaserProperties, projects);
|
||||
ProjectVersion bumpedProject = bumpProject(originalVersion, newProjects);
|
||||
@@ -166,6 +175,7 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
SKIP_SNAPSHOT_ASSERTION);
|
||||
this.projectGitHandler.commitAfterBumpingVersions(project, bumpedProject);
|
||||
log.info("\nSuccessfully reverted the commit and bumped snapshot versions");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private ProjectVersion bumpProject(ProjectVersion originalVersion,
|
||||
@@ -179,96 +189,108 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
return new ProjectVersion(project);
|
||||
}
|
||||
|
||||
public void pushCurrentBranch(File project) {
|
||||
public ExecutionResult pushCurrentBranch(File project) {
|
||||
this.projectGitHandler.pushCurrentBranch(project);
|
||||
log.info("\nSuccessfully pushed current branch");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void closeMilestone(ProjectVersion releaseVersion) {
|
||||
public ExecutionResult closeMilestone(ProjectVersion releaseVersion) {
|
||||
if (releaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't close a milestone for a SNAPSHOT version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
try {
|
||||
this.projectGitHubHandler.closeMilestone(releaseVersion);
|
||||
log.info("\nSuccessfully closed milestone");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException("Failed to create an email template");
|
||||
return ExecutionResult.unstable(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void createEmail(ProjectVersion releaseVersion, Projects projects) {
|
||||
public ExecutionResult createEmail(ProjectVersion releaseVersion, Projects projects) {
|
||||
Assert.notNull(releaseVersion,
|
||||
"You must provide a release version for your project");
|
||||
Assert.notNull(releaseVersion.version,
|
||||
"You must provide a release version for your project");
|
||||
if (releaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't create email template for a SNAPSHOT version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
try {
|
||||
File email = this.templateGenerator.email(projects);
|
||||
if (email != null) {
|
||||
log.info("\nSuccessfully created email template at location [{}]", email);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
else {
|
||||
throw new BuildUnstableException("Failed to create an email template");
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create an email template"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException("Failed to create an email template", ex);
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create an email template", ex));
|
||||
}
|
||||
}
|
||||
|
||||
public void createBlog(ProjectVersion releaseVersion, Projects projects) {
|
||||
public ExecutionResult createBlog(ProjectVersion releaseVersion, Projects projects) {
|
||||
if (releaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't create blog template for a SNAPSHOT version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
try {
|
||||
File blog = this.templateGenerator.blog(projects);
|
||||
if (blog != null) {
|
||||
log.info("\nSuccessfully created blog template at location [{}]", blog);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
else {
|
||||
throw new BuildUnstableException("Failed to create a blog template");
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create a blog template"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException("Failed to create a blog template", ex);
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create a blog template", ex));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSpringGuides(ProjectVersion releaseVersion, Projects projects,
|
||||
List<ProcessedProject> processedProjects) {
|
||||
public ExecutionResult updateSpringGuides(ProjectVersion releaseVersion,
|
||||
Projects projects, List<ProcessedProject> processedProjects) {
|
||||
if (!(releaseVersion.isRelease() || releaseVersion.isServiceRelease())) {
|
||||
log.info(
|
||||
"\nWon't update Spring Guides for a non Release / Service Release version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
Exception springGuidesException = createIssueInSpringGuides(releaseVersion,
|
||||
projects);
|
||||
Exception deployGuidesException = deployGuides(processedProjects);
|
||||
if (springGuidesException != null || deployGuidesException != null) {
|
||||
throw new BuildUnstableException(
|
||||
return ExecutionResult.unstable(new BuildUnstableException(
|
||||
"Failed to update Spring Guides. Spring Guides updated successfully ["
|
||||
+ (springGuidesException != null)
|
||||
+ "] deployed guides successfully ["
|
||||
+ (deployGuidesException != null) + "]");
|
||||
+ (deployGuidesException != null) + "]"));
|
||||
}
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
public void updateStartSpringIo(ProjectVersion releaseVersion, Projects projects) {
|
||||
public ExecutionResult updateStartSpringIo(ProjectVersion releaseVersion,
|
||||
Projects projects) {
|
||||
if (!(releaseVersion.isRelease() || releaseVersion.isServiceRelease())) {
|
||||
log.info(
|
||||
"\nWon't update start.spring.io for a non Release / Service Release version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
Exception exception = createIssueInStartSpringIo(releaseVersion, projects);
|
||||
if (exception != null) {
|
||||
throw new BuildUnstableException("Failed to update start.spring.io");
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to update start.spring.io"));
|
||||
}
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private Exception createIssueInSpringGuides(ProjectVersion releaseVersion,
|
||||
@@ -311,93 +333,110 @@ public class Releaser implements ReleaserPropertiesAware {
|
||||
}
|
||||
}
|
||||
|
||||
public void createTweet(ProjectVersion releaseVersion, Projects projects) {
|
||||
public ExecutionResult createTweet(ProjectVersion releaseVersion, Projects projects) {
|
||||
if (releaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't create tweet template for a SNAPSHOT version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
try {
|
||||
File tweet = this.templateGenerator.tweet(projects);
|
||||
if (tweet != null) {
|
||||
log.info("\nSuccessfully created tweet template at location [{}]", tweet);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
else {
|
||||
throw new BuildUnstableException("Failed to create a tweet template");
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create a tweet template"));
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException("Failed to create a tweet template", ex);
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create a tweet template", ex));
|
||||
}
|
||||
}
|
||||
|
||||
public void createReleaseNotes(ProjectVersion releaseVersion, Projects projects) {
|
||||
public ExecutionResult createReleaseNotes(ProjectVersion releaseVersion,
|
||||
Projects projects) {
|
||||
if (releaseVersion.isSnapshot()) {
|
||||
log.info("\nWon't create release notes for a SNAPSHOT version");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
try {
|
||||
File output = this.templateGenerator.releaseNotes(projects);
|
||||
log.info("\nSuccessfully created release notes at location [{}]", output);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException("Failed to create release notes", ex);
|
||||
return ExecutionResult.unstable(
|
||||
new BuildUnstableException("Failed to create release notes", ex));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSagan(File project, ProjectVersion releaseVersion,
|
||||
public ExecutionResult updateSagan(File project, ProjectVersion releaseVersion,
|
||||
Projects projects) {
|
||||
String currentBranch = this.projectGitHandler.currentBranch(project);
|
||||
ProjectVersion originalVersion = new ProjectVersion(project);
|
||||
try {
|
||||
this.saganUpdater.updateSagan(project, currentBranch, originalVersion,
|
||||
return this.saganUpdater.updateSagan(project, currentBranch, originalVersion,
|
||||
releaseVersion, projects);
|
||||
log.info("\nSuccessfully updated Sagan for branch [{}]", currentBranch);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new BuildUnstableException(ex);
|
||||
return ExecutionResult.unstable(new BuildUnstableException(ex));
|
||||
}
|
||||
}
|
||||
|
||||
public void updateDocumentationRepositoryForTrain(ReleaserProperties properties,
|
||||
Projects projects, ProjectVersion releaseVersion) {
|
||||
public ExecutionResult updateDocumentationRepositoryForTrain(
|
||||
ReleaserProperties properties, Projects projects,
|
||||
ProjectVersion releaseVersion) {
|
||||
String releaseBranch = properties.getPom().getBranch();
|
||||
this.documentationUpdater.updateDocsRepo(projects, releaseVersion, releaseBranch);
|
||||
log.info("\nSuccessfully updated documentation repository for train branch [{}]",
|
||||
File file = this.documentationUpdater.updateDocsRepo(projects, releaseVersion,
|
||||
releaseBranch);
|
||||
if (file != null) {
|
||||
log.info(
|
||||
"\nSuccessfully updated documentation repository for train branch [{}]",
|
||||
releaseBranch);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
|
||||
public void updateDocumentationRepositoryForSingleProject(Projects projects,
|
||||
ProjectVersion releaseVersion) {
|
||||
public ExecutionResult updateDocumentationRepositoryForSingleProject(
|
||||
Projects projects, ProjectVersion releaseVersion) {
|
||||
if (releaseVersion.projectName.equals(
|
||||
this.releaserProperties.getMetaRelease().getReleaseTrainProjectName())) {
|
||||
log.info("Will not update documentation for project that is a BOM project");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
this.documentationUpdater.updateDocsRepoForSingleProject(projects,
|
||||
File file = this.documentationUpdater.updateDocsRepoForSingleProject(projects,
|
||||
releaseVersion);
|
||||
log.info(
|
||||
"\nSuccessfully updated documentation repository for a project with name [{}]",
|
||||
releaseVersion.projectName);
|
||||
if (file != null) {
|
||||
log.info(
|
||||
"\nSuccessfully updated documentation repository for a project with name [{}]",
|
||||
releaseVersion.projectName);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
|
||||
public void runUpdatedSamples(Projects projects) {
|
||||
this.postReleaseActions.runUpdatedTests(projects);
|
||||
log.info("\nSuccessfully updated and ran samples");
|
||||
public ExecutionResult runUpdatedSamples(Projects projects) {
|
||||
return this.postReleaseActions.runUpdatedTests(projects);
|
||||
}
|
||||
|
||||
public void generateReleaseTrainDocumentation(Projects projects) {
|
||||
this.postReleaseActions.generateReleaseTrainDocumentation(projects);
|
||||
log.info("\nSuccessfully updated and generated release train documentation");
|
||||
public ExecutionResult generateReleaseTrainDocumentation(Projects projects) {
|
||||
return this.postReleaseActions.generateReleaseTrainDocumentation(projects);
|
||||
}
|
||||
|
||||
public void updateAllSamples(Projects projects) {
|
||||
this.postReleaseActions.updateAllTestSamples(projects);
|
||||
log.info("\nSuccessfully updated all samples");
|
||||
public ExecutionResult updateAllSamples(Projects projects) {
|
||||
return this.postReleaseActions.updateAllTestSamples(projects);
|
||||
}
|
||||
|
||||
public void updateReleaseTrainWiki(Projects projects) {
|
||||
this.documentationUpdater.updateReleaseTrainWiki(projects);
|
||||
log.info("\nSuccessfully updated project wiki");
|
||||
public ExecutionResult updateReleaseTrainWiki(Projects projects) {
|
||||
File file = this.documentationUpdater.updateReleaseTrainWiki(projects);
|
||||
if (file != null) {
|
||||
log.info("\nSuccessfully updated project wiki");
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,6 +38,7 @@ import releaser.internal.project.ProcessedProject;
|
||||
import releaser.internal.project.ProjectCommandExecutor;
|
||||
import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
import releaser.internal.versions.VersionsFetcher;
|
||||
|
||||
import org.springframework.core.NestedExceptionUtils;
|
||||
@@ -80,13 +81,14 @@ public class PostReleaseActions implements Closeable {
|
||||
* Clones the projects, checks out the proper branch and runs guides building and
|
||||
* deployment.
|
||||
* @param processedProjects - set of project with versions to assert against
|
||||
* @return result of the execution
|
||||
*/
|
||||
public void deployGuides(List<ProcessedProject> processedProjects) {
|
||||
public ExecutionResult deployGuides(List<ProcessedProject> processedProjects) {
|
||||
if (!this.properties.getGit().isUpdateSpringGuides()) {
|
||||
log.info(
|
||||
"Will not build and deploy latest Spring Guides, since the switch to do so "
|
||||
+ "is off. Set [releaser.git.update-spring-guides] to [true] to change that");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
List<ProcessedProject> latestGaProcessedProjects = processedProjects.stream()
|
||||
.filter(processedProject -> this.versionsFetcher
|
||||
@@ -98,18 +100,20 @@ public class PostReleaseActions implements Closeable {
|
||||
latestGaProcessedProjects);
|
||||
log.info("Deployed all guides!");
|
||||
assertExceptions(projectUrlAndExceptions);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones the test project, updates it and runs tests.
|
||||
* @param projects - set of project with versions to assert against
|
||||
* @return result of the execution
|
||||
*/
|
||||
public void runUpdatedTests(Projects projects) {
|
||||
public ExecutionResult runUpdatedTests(Projects projects) {
|
||||
if (!this.properties.getGit().isRunUpdatedSamples()
|
||||
|| !this.properties.getMetaRelease().isEnabled()) {
|
||||
log.info("Will not update and run test samples, since the switch to do so "
|
||||
+ "is off. Set [releaser.git.run-updated-samples] to [true] to change that");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
File file = this.projectGitHandler.cloneTestSamplesProject();
|
||||
ProjectVersion projectVersion = newProjectVersion(file);
|
||||
@@ -119,6 +123,7 @@ public class PostReleaseActions implements Closeable {
|
||||
updateWithVersions(file, newProjects);
|
||||
this.projectCommandExecutor.build(projectVersion, projectVersion,
|
||||
file.getAbsolutePath());
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,13 +131,14 @@ public class PostReleaseActions implements Closeable {
|
||||
* branch, updates all the poms with the new, bumped versions of release train
|
||||
* projects, commits the changes and pushes them.
|
||||
* @param projects - set of project with versions to assert against
|
||||
* @return result of the execution
|
||||
*/
|
||||
public void updateAllTestSamples(Projects projects) {
|
||||
public ExecutionResult updateAllTestSamples(Projects projects) {
|
||||
if (!this.properties.getGit().isUpdateAllTestSamples()
|
||||
|| !this.properties.getMetaRelease().isEnabled()) {
|
||||
log.info("Will not update all test samples, since the switch to do so "
|
||||
+ "is off. Set [releaser.git.update-all-test-samples] to [true] to change that");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
List<ProjectUrlAndException> projectUrlAndExceptions = this.properties.getGit()
|
||||
.getAllTestSampleUrls().entrySet().stream()
|
||||
@@ -140,6 +146,7 @@ public class PostReleaseActions implements Closeable {
|
||||
.flatMap(Collection::stream).collect(Collectors.toList());
|
||||
log.info("Updated all samples!");
|
||||
assertExceptions(projectUrlAndExceptions);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private void assertExceptions(List<ProjectUrlAndException> projectUrlAndExceptions) {
|
||||
@@ -283,14 +290,15 @@ public class PostReleaseActions implements Closeable {
|
||||
/**
|
||||
* Clones the release train documentation project.
|
||||
* @param projects - set of project with versions to assert against
|
||||
* @return result of the execution
|
||||
*/
|
||||
public void generateReleaseTrainDocumentation(Projects projects) {
|
||||
public ExecutionResult generateReleaseTrainDocumentation(Projects projects) {
|
||||
if (!this.properties.getGit().isUpdateReleaseTrainDocs()
|
||||
|| !this.properties.getMetaRelease().isEnabled()) {
|
||||
log.info(
|
||||
"Will not update the release train documentation, since the switch to do so "
|
||||
+ "is off. Set [releaser.git.update-release-train-docs] to [true] to change that");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
File file = this.projectGitHandler.cloneReleaseTrainDocumentationProject();
|
||||
ProjectVersion projectVersion = newProjectVersion(file);
|
||||
@@ -300,6 +308,7 @@ public class PostReleaseActions implements Closeable {
|
||||
updateWithVersions(file, newProjects);
|
||||
this.projectCommandExecutor.generateReleaseTrainDocs(releaseTrainVersion,
|
||||
file.getAbsolutePath());
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private Projects addVersionForTestsProject(Projects projects,
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.project.ProjectVersion;
|
||||
import releaser.internal.project.Projects;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -48,13 +49,13 @@ public class SaganUpdater {
|
||||
this.releaserProperties = releaserProperties;
|
||||
}
|
||||
|
||||
public void updateSagan(File projectFile, String branch,
|
||||
public ExecutionResult updateSagan(File projectFile, String branch,
|
||||
ProjectVersion originalVersion, ProjectVersion currentVersion,
|
||||
Projects projects) {
|
||||
if (!this.releaserProperties.getSagan().isUpdateSagan()) {
|
||||
log.info("Will not update sagan, since the switch to do so "
|
||||
+ "is off. Set [releaser.sagan.update-sagan] to [true] to change that");
|
||||
return;
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
ReleaseUpdate update = releaseUpdate(branch, originalVersion, currentVersion,
|
||||
projects);
|
||||
@@ -74,7 +75,9 @@ public class SaganUpdater {
|
||||
+ "the current version [" + currentVersion
|
||||
+ "] is older than that one. " + "Will do nothing."
|
||||
: "No latest version found. Will do nothing.");
|
||||
return ExecutionResult.skipped();
|
||||
}
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
private void updateDocumentationIfNecessary(File projectFile, Project project) {
|
||||
|
||||
@@ -14,14 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package releaser.internal.spring;
|
||||
package releaser.internal.tech;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import releaser.internal.tech.BuildUnstableException;
|
||||
|
||||
/**
|
||||
* Task execution result. Contains a list of exceptions thrown while running the task.
|
||||
@@ -31,15 +30,26 @@ public class ExecutionResult implements Serializable {
|
||||
|
||||
private List<Exception> exceptions = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Consider an enum in the future.
|
||||
*/
|
||||
private boolean skipped;
|
||||
|
||||
public ExecutionResult() {
|
||||
}
|
||||
|
||||
public ExecutionResult(Exception throwable) {
|
||||
this.exceptions.add(throwable);
|
||||
this.skipped = false;
|
||||
}
|
||||
|
||||
public ExecutionResult(List<Exception> throwables) {
|
||||
this.exceptions.addAll(throwables);
|
||||
this.skipped = false;
|
||||
}
|
||||
|
||||
public ExecutionResult(boolean skipped) {
|
||||
this.skipped = skipped;
|
||||
}
|
||||
|
||||
public static ExecutionResult success() {
|
||||
@@ -50,11 +60,19 @@ public class ExecutionResult implements Serializable {
|
||||
return new ExecutionResult(throwable);
|
||||
}
|
||||
|
||||
public static ExecutionResult failure(List<Exception> throwables) {
|
||||
return new ExecutionResult(throwables);
|
||||
}
|
||||
|
||||
public static ExecutionResult unstable(Exception ex) {
|
||||
return new ExecutionResult(ex instanceof BuildUnstableException ? ex
|
||||
: new BuildUnstableException(ex));
|
||||
}
|
||||
|
||||
public static ExecutionResult skipped() {
|
||||
return new ExecutionResult(true);
|
||||
}
|
||||
|
||||
public RuntimeException foundExceptions() {
|
||||
if (this.exceptions.isEmpty()) {
|
||||
return null;
|
||||
@@ -81,6 +99,11 @@ public class ExecutionResult implements Serializable {
|
||||
.allMatch(t -> t instanceof BuildUnstableException);
|
||||
}
|
||||
|
||||
public String toStringResult() {
|
||||
return isUnstable() ? "UNSTABLE"
|
||||
: isFailure() ? "FAILURE" : isSkipped() ? "SKIPPED" : "SUCCESS";
|
||||
}
|
||||
|
||||
public boolean isFailure() {
|
||||
return !this.exceptions.isEmpty() && this.exceptions.stream()
|
||||
.anyMatch(t -> !(t instanceof BuildUnstableException));
|
||||
@@ -102,6 +125,14 @@ public class ExecutionResult implements Serializable {
|
||||
this.exceptions = exceptions;
|
||||
}
|
||||
|
||||
public boolean isSkipped() {
|
||||
return this.skipped;
|
||||
}
|
||||
|
||||
public void setSkipped(boolean skipped) {
|
||||
this.skipped = skipped;
|
||||
}
|
||||
|
||||
private static final class MergedThrowable extends RuntimeException
|
||||
implements Serializable {
|
||||
|
||||
@@ -18,9 +18,9 @@ package releaser;
|
||||
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.options.Parser;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.ExecutionResultHandler;
|
||||
import releaser.internal.spring.SpringReleaser;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package releaser.internal.spring;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.options.OptionsBuilder;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
/**
|
||||
* Releaser that gets input from console.
|
||||
|
||||
@@ -18,6 +18,8 @@ package releaser.internal.spring;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
/**
|
||||
* Handles the result of the execution of the train or project release. Example: You can
|
||||
* print the results in a table, throw exceptions when the build was faulty or just log
|
||||
|
||||
@@ -19,6 +19,7 @@ package releaser.internal.spring;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.tasks.ReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
/**
|
||||
* Knows how to run a flow of tasks.
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.jakewharton.fliptables.FlipTableConverters;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
@@ -145,12 +146,10 @@ class SpringBatchExecutionResultHandler implements ExecutionResultHandler {
|
||||
"***** Project / Task : <%s/%s> ***** \nTask Description <%s>\nException Stacktrace \n\n%s",
|
||||
table1.projectName, table1.taskCaption,
|
||||
table1.taskDescription,
|
||||
table1.exceptions + "\n"
|
||||
+ table1.exceptions.stream()
|
||||
.map(Throwable::getStackTrace)
|
||||
.flatMap(e -> Arrays.stream(e))
|
||||
.map(StackTraceElement::toString)
|
||||
.collect(Collectors.joining("\n"))))
|
||||
table1.exceptions + "\n" + table1.exceptions.stream()
|
||||
.map(Throwable::getStackTrace).flatMap(Arrays::stream)
|
||||
.map(StackTraceElement::toString)
|
||||
.collect(Collectors.joining("\n"))))
|
||||
.collect(Collectors.joining("\n\n"));
|
||||
log.warn(string + brokenBuilds);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.concurrent.Future;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
import org.slf4j.Logger;
|
||||
@@ -40,6 +39,7 @@ import releaser.internal.tasks.PostReleaseReleaserTask;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tasks.ReleaserTask;
|
||||
import releaser.internal.tech.BuildUnstableException;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.batch.core.ExitStatus;
|
||||
import org.springframework.batch.core.Job;
|
||||
@@ -128,13 +128,14 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
|
||||
.getStepExecution().getExecutionContext().get("errors");
|
||||
RuntimeException exception = result.foundExceptions();
|
||||
errors = addExceptionToErrors(errors, exception);
|
||||
String status = result.isUnstable() ? "UNSTABLE"
|
||||
: result.isFailure() ? "FAILURE" : "SUCCESS";
|
||||
String status = result.toStringResult();
|
||||
ExecutionResultReport entity = buildEntity(releaserTask, args,
|
||||
status, errors);
|
||||
contribution.getStepExecution().getExecutionContext()
|
||||
.put("entity", entity);
|
||||
if (result.isFailureOrUnstable()) {
|
||||
log.warn("The execution of [{}] failed or was unstable",
|
||||
entity.getReleaserTaskType().getSimpleName());
|
||||
contribution.getStepExecution().getExecutionContext()
|
||||
.put("errors", errors);
|
||||
}
|
||||
@@ -252,9 +253,7 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
|
||||
List<ExecutionResult> results = new LinkedList<>();
|
||||
for (StuffToRun flow : flows) {
|
||||
log.info("Releasing group [{}]", flow.releaseGroup);
|
||||
ExecutionResult executionResult = runInParallel(flow, flow.task).stream()
|
||||
.map(this::result)
|
||||
.reduce(new ExecutionResult(), ExecutionResult::merge);
|
||||
ExecutionResult executionResult = runInParallel(flow);
|
||||
log.info("Group [{}] execution result is [{}]", flow.releaseGroup,
|
||||
executionResult);
|
||||
if (executionResult.isFailure()) {
|
||||
@@ -267,8 +266,7 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
|
||||
return results.stream().reduce(new ExecutionResult(), ExecutionResult::merge);
|
||||
}
|
||||
// will run in sequence
|
||||
return flows.stream().map(s -> runInSequence(s, s.task)).flatMap(s -> s)
|
||||
.reduce(new ExecutionResult(), ExecutionResult::merge);
|
||||
return runInSequence(flows);
|
||||
}
|
||||
|
||||
private ExecutionResult result(Future<ExecutionResult> future) {
|
||||
@@ -280,23 +278,47 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
private List<Future<ExecutionResult>> runInParallel(StuffToRun stuffToRun,
|
||||
CompositeReleaserTask releaserTask) {
|
||||
private ExecutionResult runInParallel(StuffToRun stuffToRun) {
|
||||
ExecutionResult results = ExecutionResult.success();
|
||||
log.info("Running composite tasks in parallel for {}", stuffToRun.releaseGroup);
|
||||
return stuffToRun.releaseGroup.projectsToRun.stream().map(s -> {
|
||||
for (ProjectToRun.ProjectToRunSupplier s : stuffToRun.releaseGroup.projectsToRun) {
|
||||
CompositeReleaserTask releaserTask = stuffToRun.task;
|
||||
log.info("Scheduling a build for project [{}]", s.projectName());
|
||||
return this.executorService.submit(() -> {
|
||||
List<Future<ExecutionResult>> futures = new LinkedList<>();
|
||||
futures.add(this.executorService.submit(() -> {
|
||||
log.info("Running a composite task [{}] in parallel",
|
||||
releaserTask.name());
|
||||
return releaserTask.apply(Arguments.forProject(s.get()));
|
||||
});
|
||||
}).collect(Collectors.toCollection(LinkedList::new));
|
||||
}));
|
||||
boolean atLeastOneFailure = false;
|
||||
for (Future<ExecutionResult> future : futures) {
|
||||
ExecutionResult result = result(future);
|
||||
results = results.merge(result);
|
||||
if (result.isFailure()) {
|
||||
atLeastOneFailure = true;
|
||||
}
|
||||
}
|
||||
if (atLeastOneFailure) {
|
||||
log.warn(
|
||||
"At least one project failed within the group, will NOT continue with subsequent groups");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private Stream<ExecutionResult> runInSequence(StuffToRun stuffToRun,
|
||||
CompositeReleaserTask releaserTask) {
|
||||
return stuffToRun.releaseGroup.projectsToRun.stream()
|
||||
.map(s -> releaserTask.apply(Arguments.forProject(s.get())));
|
||||
private ExecutionResult runInSequence(List<StuffToRun> stuffToRunList) {
|
||||
ExecutionResult result = ExecutionResult.success();
|
||||
for (StuffToRun stuffToRun : stuffToRunList) {
|
||||
for (ProjectToRun.ProjectToRunSupplier s : stuffToRun.releaseGroup.projectsToRun) {
|
||||
result = result
|
||||
.merge(stuffToRun.task.apply(Arguments.forProject(s.get())));
|
||||
if (result.isFailure()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Job buildJobForFlows(Iterator<StuffToRun> flowsIterator) {
|
||||
@@ -397,7 +419,7 @@ class SpringBatchFlowRunner implements FlowRunner, Closeable {
|
||||
if (thrownExceptions.isEmpty()) {
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
return new ExecutionResult(thrownExceptions);
|
||||
return ExecutionResult.failure(thrownExceptions);
|
||||
}
|
||||
catch (JobExecutionException ex) {
|
||||
return ExecutionResult.failure(ex);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package releaser.internal.spring;
|
||||
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
/**
|
||||
* Contract for releasing a project or train .
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package releaser.internal.tasks;
|
||||
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
/**
|
||||
* Marker interface for running post release tasks.
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.util.function.Function;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tech.BuildUnstableException;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.FlowRunner;
|
||||
import releaser.internal.spring.ProjectToRun;
|
||||
import releaser.internal.spring.ProjectsToRun;
|
||||
import releaser.internal.spring.TasksToRun;
|
||||
import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tasks.DryRunReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.FlowRunner;
|
||||
import releaser.internal.spring.ProjectToRun;
|
||||
import releaser.internal.spring.ProjectsToRun;
|
||||
@@ -36,6 +35,7 @@ import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tasks.ProjectPostReleaseReleaserTask;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tasks.ReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.options.Options;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.spring.FlowRunner;
|
||||
import releaser.internal.spring.TasksToRun;
|
||||
import releaser.internal.tasks.CompositeReleaserTask;
|
||||
import releaser.internal.tasks.ReleaserTask;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ProjectPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class CloseMilestonesProjectPostReleaseTask
|
||||
implements ProjectPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class CloseMilestonesProjectPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.closeMilestone(args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.closeMilestone(args.versionFromBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class CreateTemplatesTrainPostReleaseTask implements TrainPostReleaseReleaserTask {
|
||||
|
||||
@@ -56,11 +56,11 @@ public class CreateTemplatesTrainPostReleaseTask implements TrainPostReleaseRele
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.createEmail(args.versionFromBom, args.projects);
|
||||
this.releaser.createBlog(args.versionFromBom, args.projects);
|
||||
this.releaser.createTweet(args.versionFromBom, args.projects);
|
||||
this.releaser.createReleaseNotes(args.versionFromBom, args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.createEmail(args.versionFromBom, args.projects)
|
||||
.merge(this.releaser.createBlog(args.versionFromBom, args.projects))
|
||||
.merge(this.releaser.createTweet(args.versionFromBom, args.projects))
|
||||
.merge(this.releaser.createReleaseNotes(args.versionFromBom,
|
||||
args.projects));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class RunUpdatedSamplesTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class RunUpdatedSamplesTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.runUpdatedSamples(args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.runUpdatedSamples(args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateAllTestSamplesTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class UpdateAllTestSamplesTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateAllSamples(args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.updateAllSamples(args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ProjectPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateDocsRepositoryProjectPostReleaseTask
|
||||
implements ProjectPostReleaseReleaserTask {
|
||||
@@ -57,9 +57,8 @@ public class UpdateDocsRepositoryProjectPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateDocumentationRepositoryForSingleProject(args.projects,
|
||||
return this.releaser.updateDocumentationRepositoryForSingleProject(args.projects,
|
||||
args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateDocsRepositoryTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,9 +57,8 @@ public class UpdateDocsRepositoryTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateDocumentationRepositoryForTrain(args.properties,
|
||||
return this.releaser.updateDocumentationRepositoryForTrain(args.properties,
|
||||
args.projects, args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateGuidesTrainPostReleaseTask implements TrainPostReleaseReleaserTask {
|
||||
|
||||
@@ -56,9 +56,8 @@ public class UpdateGuidesTrainPostReleaseTask implements TrainPostReleaseRelease
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateSpringGuides(args.versionFromBom, args.projects,
|
||||
return this.releaser.updateSpringGuides(args.versionFromBom, args.projects,
|
||||
args.processedProjects);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateReleaseTrainDocsTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class UpdateReleaseTrainDocsTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.generateReleaseTrainDocumentation(args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.generateReleaseTrainDocumentation(args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateReleaseTrainWikiTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class UpdateReleaseTrainWikiTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateReleaseTrainWiki(args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.updateReleaseTrainWiki(args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ProjectPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateSaganProjectPostReleaseTask implements ProjectPostReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,8 @@ public class UpdateSaganProjectPostReleaseTask implements ProjectPostReleaseRele
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateSagan(args.project, args.versionFromBom, args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.updateSagan(args.project, args.versionFromBom,
|
||||
args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.postrelease;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.TrainPostReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdateStartSpringIoTrainPostReleaseTask
|
||||
implements TrainPostReleaseReleaserTask {
|
||||
@@ -57,8 +57,7 @@ public class UpdateStartSpringIoTrainPostReleaseTask
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateStartSpringIo(args.versionFromBom, args.projects);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.updateStartSpringIo(args.versionFromBom, args.projects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.DryRunReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class BuildProjectReleaseTask implements DryRunReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,7 @@ public class BuildProjectReleaseTask implements DryRunReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.buildProject(args.originalVersion, args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.buildProject(args.originalVersion, args.versionFromBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class BumpBackToSnapshotReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@@ -56,9 +56,8 @@ public class BumpBackToSnapshotReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.rollbackReleaseVersion(args.project, args.projects,
|
||||
return this.releaser.rollbackReleaseVersion(args.project, args.projects,
|
||||
args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class CommitReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,7 @@ public class CommitReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.commitAndPushTags(args.project, args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.commitAndPushTags(args.project, args.versionFromBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class DeployArtifactsReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,7 @@ public class DeployArtifactsReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.deploy(args.originalVersion, args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.deploy(args.originalVersion, args.versionFromBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class PublishDocsReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,7 @@ public class PublishDocsReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.publishDocs(args.originalVersion, args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.publishDocs(args.originalVersion, args.versionFromBom);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.ReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class PushChangesReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@@ -56,8 +56,7 @@ public class PushChangesReleaseTask implements ReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.pushCurrentBranch(args.project);
|
||||
return ExecutionResult.success();
|
||||
return this.releaser.pushCurrentBranch(args.project);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ package releaser.internal.tasks.release;
|
||||
|
||||
import releaser.internal.Releaser;
|
||||
import releaser.internal.spring.Arguments;
|
||||
import releaser.internal.spring.ExecutionResult;
|
||||
import releaser.internal.tasks.DryRunReleaseReleaserTask;
|
||||
import releaser.internal.tech.ExecutionResult;
|
||||
|
||||
public class UpdatingPomsReleaseTask implements DryRunReleaseReleaserTask {
|
||||
|
||||
@@ -56,9 +56,8 @@ public class UpdatingPomsReleaseTask implements DryRunReleaseReleaserTask {
|
||||
|
||||
@Override
|
||||
public ExecutionResult runTask(Arguments args) {
|
||||
this.releaser.updateProjectFromBom(args.project, args.projects,
|
||||
return this.releaser.updateProjectFromBom(args.project, args.projects,
|
||||
args.versionFromBom);
|
||||
return ExecutionResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.assertj.core.api.BDDAssertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
|
||||
class SpringBatchFlowRunnerTests {
|
||||
class ProjectsToReleaseGroupsTests {
|
||||
|
||||
@Test
|
||||
void releaseGroup() {
|
||||
Reference in New Issue
Block a user