org.jvnet.hudson.test
Class CaptureEnvironmentBuilder

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Builder
          extended by org.jvnet.hudson.test.CaptureEnvironmentBuilder
All Implemented Interfaces:
ExtensionPoint, Describable<Builder>, BuildStep

public class CaptureEnvironmentBuilder
extends Builder

Builder that captures the environment variables used during a build.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class CaptureEnvironmentBuilder.DescriptorImpl
           
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
CaptureEnvironmentBuilder()
           
 
Method Summary
 EnvVars getEnvVars()
           
 boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener)
          Runs the step over the given build and reports the progress to the listener.
 
Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
 

Constructor Detail

CaptureEnvironmentBuilder

public CaptureEnvironmentBuilder()
Method Detail

getEnvVars

public EnvVars getEnvVars()

perform

public boolean perform(AbstractBuild<?,?> build,
                       Launcher launcher,
                       BuildListener listener)
                throws InterruptedException,
                       IOException
Description copied from interface: BuildStep
Runs the step over the given build and reports the progress to the listener.

A plugin can contribute the action object to Actionable.getActions() so that a 'report' becomes a part of the persisted data of Build. This is how JUnit plugin attaches the test report to a build page, for example.

Specified by:
perform in interface BuildStep
Overrides:
perform in class BuildStepCompatibilityLayer
Returns:
true if the build can continue, false if there was an error and the build needs to be aborted.

Using the return value to indicate success/failure should be considered deprecated, and implementations are encouraged to throw AbortException to indicate a failure.

Throws:
InterruptedException - If the build is interrupted by the user (in an attempt to abort the build.) Normally the BuildStep implementations may simply forward the exception it got from its lower-level functions.
IOException - If the implementation wants to abort the processing when an IOException happens, it can simply propagate the exception to the caller. This will cause the build to fail, with the default error message. Implementations are encouraged to catch IOException on its own to provide a better error message, if it can do so, so that users have better understanding on why it failed.


Copyright © 2004-2013. All Rights Reserved.