Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify BuildStepListeners before and after a BuildStep is performed #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.BuildStepListener;
import hudson.model.Describable;
import hudson.model.Descriptor;
import hudson.model.Hudson;
Expand Down Expand Up @@ -109,7 +110,21 @@ public boolean evaluate() throws Exception {
return condition.runPerform(build, listener);
}
public boolean run() throws IOException, InterruptedException {
return buildStep.perform(build, launcher, listener);
boolean stepResult = false;

for (BuildStepListener stepListener : BuildStepListener.all()) {
stepListener.started(build, buildStep, listener);
}

try {
stepResult = buildStep.perform(build, launcher, listener);
}
finally {
for (BuildStepListener buildStepListener : BuildStepListener.all()) {
buildStepListener.finished(build, buildStep, listener, stepResult);
}
}
return stepResult;
}
public void logRunning(final boolean running) {
if (running) {
Expand Down