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

[JENKINS-26133] Return exit status or stdout from sh/bat steps #11

Merged
merged 2 commits into from Jul 13, 2016

Conversation

Projects
None yet
4 participants
@jglick
Copy link
Member

commented Jul 12, 2016

Downstream of jenkinsci/durable-task-plugin#27.

  • returnStdout
  • returnStatus

@reviewbybees

@reviewbybees

This comment has been minimized.

Copy link

commented Jul 13, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.


public abstract static class DurableTaskStepDescriptor extends AbstractStepDescriptorImpl {

public static final String defaultEncoding = "UTF-8";

This comment has been minimized.

Copy link
@rsandell

rsandell Jul 13, 2016

Member

annoying nit constants are usually capitalized.

This comment has been minimized.

Copy link
@jglick

jglick Jul 13, 2016

Author Member

We tend to break that rule for this idiom.

@rsandell

This comment has been minimized.

Copy link
Member

commented Jul 13, 2016

🐝

@jglick jglick merged commit 94ad105 into jenkinsci:master Jul 13, 2016

1 check passed

Jenkins This pull request looks good
Details

@jglick jglick deleted the jglick:return-value-JENKINS-26133 branch Jul 13, 2016

if (exitCode == 0) {
getContext().onSuccess(exitCode);
if (returnStatus || exitCode == 0) {
getContext().onSuccess(returnStatus ? exitCode : returnStdout ? new String(controller.getOutput(workspace, launcher), encoding) : null);
} else {
getContext().onFailure(new AbortException("script returned exit code " + exitCode));

This comment has been minimized.

Copy link
@amuniz

amuniz Jul 14, 2016

Member

I guess someone configuring returnStdout expects to get the stdout even when the step fails, but in the exception message maybe...

Belated 🐛 I guess

This comment has been minimized.

Copy link
@jglick

jglick Jul 26, 2016

Author Member

Filed #13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.