public abstract class Command extends Object
Modifier | Constructor and Description |
---|---|
protected |
Command(String command,
boolean ignoreExitCode)
Constructor using fields.
|
Modifier and Type | Method and Description |
---|---|
protected hudson.FilePath |
createScriptFile(hudson.FilePath dir)
Create content of the script execute.
|
static Command |
get(boolean isUnix,
String executable,
CommandNature nature,
String command,
boolean ignoreExitCode)
Get the right command executor.
|
protected abstract hudson.util.ArgumentListBuilder |
getArguments(hudson.FilePath script)
Get the command line to execute.
|
protected String |
getCommand()
Get the content of the script to execute.
|
protected abstract String |
getContents()
Get the content of the script file
|
protected hudson.EnvVars |
getEnvironment(hudson.FilePath pwd,
hudson.EnvVars environment)
Be able to have a late environment processing.
|
protected abstract String |
getExtension()
Get the extension of the script file.
|
protected boolean |
isExitCodeIgnored()
Is the exit code ignored?
|
boolean |
launch(hudson.Launcher launcher,
hudson.model.TaskListener listener,
hudson.EnvVars environment,
hudson.FilePath pwd)
Launch the command.
|
protected Command(String command, boolean ignoreExitCode)
command
- The content of the execution scriptignoreExitCode
- Is exit code ignored?protected String getCommand()
protected boolean isExitCodeIgnored()
protected abstract String getExtension()
protected abstract String getContents()
protected abstract hudson.util.ArgumentListBuilder getArguments(hudson.FilePath script)
script
- The script to executeprotected hudson.EnvVars getEnvironment(hudson.FilePath pwd, hudson.EnvVars environment)
pwd
- The working directoryenvironment
- The environmentprotected hudson.FilePath createScriptFile(hudson.FilePath dir) throws IOException, InterruptedException
dir
- The folder in which the script is createdIOException
InterruptedException
public boolean launch(hudson.Launcher launcher, hudson.model.TaskListener listener, hudson.EnvVars environment, hudson.FilePath pwd) throws InterruptedException
launcher
- The launcherlistener
- The listenerenvironment
- The environmentpwd
- The current directoryInterruptedException
public static Command get(boolean isUnix, String executable, CommandNature nature, String command, boolean ignoreExitCode)
isUnix
- Target execution platformexecutable
- The PYTHON executablenature
- The nature of the command: PYTHON, shell, X shellcommand
- The content of the script to executeignoreExitCode
- Is exit code ignored?Copyright © 2004-2018. All Rights Reserved.