Class CommandInterperterCondition
- java.lang.Object
-
- org.jenkins_ci.plugins.run_condition.RunCondition
-
- org.jenkins_ci.plugins.run_condition.common.AlwaysPrebuildRunCondition
-
- org.jenkins_ci.plugins.run_condition.contributed.CommandInterperterCondition
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<RunCondition>
- Direct Known Subclasses:
BatchFileCondition
,ShellCondition
public abstract class CommandInterperterCondition extends AlwaysPrebuildRunCondition
Common part betweenShellCondition
andBatchFileCondition
.- Author:
- Chris Johnson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
RunCondition.RunConditionDescriptor
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description CommandInterperterCondition(String command)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String[]
buildCommandLine(FilePath script)
FilePath
createScriptFile(FilePath dir)
Creates a script file in a temporary name in the specified directory.String
getCommand()
protected abstract String
getContents()
protected abstract String
getFileExtension()
boolean
runPerform(AbstractBuild<?,?> build, BuildListener listener)
Decide whether to run the perform method in the BuildStep.-
Methods inherited from class org.jenkins_ci.plugins.run_condition.common.AlwaysPrebuildRunCondition
runPrebuild
-
Methods inherited from class org.jenkins_ci.plugins.run_condition.RunCondition
all, getDescriptor
-
-
-
-
Field Detail
-
command
protected final String command
Command to execute. The format depends on the actualCommandInterperterCondition
implementation.
-
-
Constructor Detail
-
CommandInterperterCondition
public CommandInterperterCondition(String command)
-
-
Method Detail
-
getCommand
public final String getCommand()
-
runPerform
public boolean runPerform(AbstractBuild<?,?> build, BuildListener listener) throws InterruptedException
Description copied from class:RunCondition
Decide whether to run the perform method in the BuildStep.- Specified by:
runPerform
in classRunCondition
- Returns:
- true if the perform method of the BuildStep should run
- Throws:
InterruptedException
-
createScriptFile
public FilePath createScriptFile(FilePath dir) throws IOException, InterruptedException
Creates a script file in a temporary name in the specified directory.- Throws:
IOException
InterruptedException
-
getContents
protected abstract String getContents()
-
getFileExtension
protected abstract String getFileExtension()
-
-