Class ClientCommandRunner
- java.lang.Object
-
- com.openshift.jenkins.plugins.util.ClientCommandRunner
-
- All Implemented Interfaces:
Serializable
public class ClientCommandRunner extends Object implements Serializable
ClientCommandRunner
runs `oc` on a slave- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ClientCommandRunner.OutputObserver
aClientCommandRunner.OutputObserver
will be notified whenClientCommandRunner
reads a new line from stdout or stderr of the running oc process
-
Constructor Summary
Constructors Constructor Description ClientCommandRunner(String[] command, FilePath filePath, EnvVars envVars, ClientCommandRunner.OutputObserver stdoutOutputObserver, ClientCommandRunner.OutputObserver stderrOutputObserver)
Create a newClientCommandRunner
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
run(Launcher launcher)
Run `oc` on a slave and wait for it to be exit
-
-
-
Constructor Detail
-
ClientCommandRunner
public ClientCommandRunner(@Nonnull String[] command, @Nonnull FilePath filePath, @Nonnull EnvVars envVars, @Nonnull ClientCommandRunner.OutputObserver stdoutOutputObserver, @Nonnull ClientCommandRunner.OutputObserver stderrOutputObserver)
Create a newClientCommandRunner
instance.- Parameters:
command
- command to run OpenShift client toolfilePath
- current directoryenvVars
- environment variablesstdoutOutputObserver
- aClientCommandRunner.OutputObserver
that will be notified wheneverClientCommandRunner
reads a line from stdout of `oc` processstderrOutputObserver
- aClientCommandRunner.OutputObserver
that will be notified wheneverClientCommandRunner
reads a line from stderr of `oc` process
-
-
Method Detail
-
run
public int run(@Nonnull Launcher launcher) throws IOException, InterruptedException, ExecutionException
Run `oc` on a slave and wait for it to be exit- Parameters:
launcher
- Launcher for launching a remote process- Returns:
- the exit status code of `oc`
- Throws:
IOException
- when error reading stdin/stdout or calling the observersInterruptedException
- when the reading threads are interruptedExecutionException
- error when executing closures of observers
-
-