Skip to content
Permalink
Browse files
Merge pull request #12 from vernyquartara/JENKINS-22850
[FIXED JENKINS-22850] [FIXED JENKINS-6851] Added option on "Automatic Rebase" action to fail the build when merge conflicts are found.
  • Loading branch information
hugueschabot committed May 5, 2014
2 parents 368a057 + f1058d1 commit ca285ed64c316ae769363291c7033a27bb90a4ed
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 ca285ed

Please sign in to comment.