Skip to content
Permalink
Browse files
[FIXED JENKINS-22850]
Added a checkbox in the pre-build-step configuration, to let the user
choose whether to stop the build or not in the case the of a failed
automatic rebase
  • Loading branch information
vernyquartara committed May 5, 2014
1 parent 368a057 commit f1058d129b36f77a5f84117c3c52e1a43d5fab0a
Showing with 12 additions and 3 deletions.
  1. +9 −3 src/main/java/jenkins/plugins/svnmerge/RebaseBuilder.java
  2. +3 −0 src/main/resources/jenkins/plugins/svnmerge/RebaseBuilder/config.groovy
@@ -22,16 +22,22 @@
* {@link Permalink#getId() id} of the permalink to rebase with.
*/
public final String permalink;
/**
* Indicates whether to stop the build if the merge fails.
*/
public final boolean stopBuildIfMergeFails;

@DataBoundConstructor
public RebaseBuilder(String permalink) {
public RebaseBuilder(String permalink, boolean stopBuildIfMergeFails) {
this.permalink = permalink;
this.stopBuildIfMergeFails = stopBuildIfMergeFails;
}

@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
new RebaseAction(build.getProject()).perform(listener,new RebaseSetting(permalink));
return true;
RebaseAction rebaseAction = new RebaseAction(build.getProject());
long result = rebaseAction.perform(listener,new RebaseSetting(permalink));
return !stopBuildIfMergeFails || result >= 0;
}

@Extension
@@ -5,3 +5,6 @@ def f = namespace(FormTagLib.class)
f.entry(title:_("Build to rebase to"), field:"permalink") {
f.select()
}
f.entry(title:_("Stop the build if the merge fails"), field:"stopBuildIfMergeFails") {
f.checkbox()
}

0 comments on commit f1058d1

Please sign in to comment.