Skip to content

Commit

Permalink
JENKINS-25959: Ensuring post-build only done if result okay
Browse files Browse the repository at this point in the history
  • Loading branch information
Bue Petersen committed Dec 11, 2014
1 parent 70cc37d commit 9cda554
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -481,7 +481,6 @@ private boolean validateMultiScm(List<SCM> scms) throws UnsupportedConfiguration

@Override
public void handlePostBuild(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws IOException {
Result result = build.getResult();
updateBuildDescription(build, launcher, listener);

// The purpose of this section of code is to disallow usage of the master branch as the polling branch.
Expand All @@ -498,6 +497,7 @@ public void handlePostBuild(AbstractBuild<?, ?> build, Launcher launcher, BuildL
build.setResult(Result.FAILURE);
}

Result result = build.getResult();
if (result != null && result.isBetterOrEqualTo(getRequiredResult())) {
listener.getLogger().println(LOG_PREFIX + "Commiting changes");
commit(build, launcher, listener);
Expand Down

0 comments on commit 9cda554

Please sign in to comment.