Class ClientCommandRunner
java.lang.Object
com.openshift.jenkins.plugins.util.ClientCommandRunner
- All Implemented Interfaces:
Serializable
ClientCommandRunner
runs `oc` on a slave- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
aClientCommandRunner.OutputObserver
will be notified whenClientCommandRunner
reads a new line from stdout or stderr of the running oc process -
Constructor Summary
ConstructorsConstructorDescriptionClientCommandRunner
(String[] command, FilePath filePath, EnvVars envVars, ClientCommandRunner.OutputObserver stdoutOutputObserver, ClientCommandRunner.OutputObserver stderrOutputObserver) Create a newClientCommandRunner
instance. -
Method Summary
-
Constructor Details
-
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 Details
-
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
-