Package hudson.tasks
Class Shell
-
- All Implemented Interfaces:
ExtensionPoint,Describable<Builder>,BuildStep,EnvVarsFilterableBuilder
public class Shell extends CommandInterpreter
Executes a series of commands by using a shell.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShell.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 class hudson.tasks.CommandInterpreter
command, configuredLocalRules
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]buildCommandLine(FilePath script)protected StringgetContents()Shell.DescriptorImplgetDescriptor()Gets the descriptor for this instance.protected StringgetFileExtension()IntegergetUnstableReturn()protected booleanisErrorlevelForUnstableBuild(int exitCode)Determines whether a non-zero exit code from the process should change the build status toResult.UNSTABLEinstead of defaultResult.FAILURE.voidsetConfiguredLocalRules(List<EnvVarsFilterLocalRule> configuredLocalRules)Set local environment variable filter rulesvoidsetUnstableReturn(Integer unstableReturn)-
Methods inherited from class hudson.tasks.CommandInterpreter
buildEnvVarsFilterRules, createScriptFile, getCommand, getConfiguredLocalRules, join, perform, perform
-
Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, prebuild
-
-
-
-
Constructor Detail
-
Shell
@DataBoundConstructor public Shell(String command)
-
-
Method Detail
-
setConfiguredLocalRules
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) @DataBoundSetter public void setConfiguredLocalRules(List<EnvVarsFilterLocalRule> configuredLocalRules)
Set local environment variable filter rules- Parameters:
configuredLocalRules- list of local environment filter rules- Since:
- 2.246
-
buildCommandLine
public String[] buildCommandLine(FilePath script)
- Specified by:
buildCommandLinein classCommandInterpreter
-
getContents
protected String getContents()
- Specified by:
getContentsin classCommandInterpreter
-
getFileExtension
protected String getFileExtension()
- Specified by:
getFileExtensionin classCommandInterpreter
-
getUnstableReturn
@CheckForNull public final Integer getUnstableReturn()
-
setUnstableReturn
@DataBoundSetter public void setUnstableReturn(Integer unstableReturn)
-
isErrorlevelForUnstableBuild
protected boolean isErrorlevelForUnstableBuild(int exitCode)
Description copied from class:CommandInterpreterDetermines whether a non-zero exit code from the process should change the build status toResult.UNSTABLEinstead of defaultResult.FAILURE. Changing toResult.UNSTABLEdoes not abort the build, next steps are continued.- Overrides:
isErrorlevelForUnstableBuildin classCommandInterpreter
-
getDescriptor
public Shell.DescriptorImpl getDescriptor()
Description copied from interface:DescribableGets the descriptor for this instance.Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<Builder>- Overrides:
getDescriptorin classBuilder
-
-