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 interfaceaClientCommandRunner.OutputObserverwill be notified whenClientCommandRunnerreads 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 newClientCommandRunnerinstance. -
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 newClientCommandRunnerinstance.- Parameters:
command- command to run OpenShift client toolfilePath- current directoryenvVars- environment variablesstdoutOutputObserver- aClientCommandRunner.OutputObserverthat will be notified wheneverClientCommandRunnerreads a line from stdout of `oc` processstderrOutputObserver- aClientCommandRunner.OutputObserverthat will be notified wheneverClientCommandRunnerreads 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
-