envVars.put(e.getKey(),e.getValue()); r = join(launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).start());
private List<String> buildArguments(Command command, String scriptContent) throws IOException, InterruptedException { CommandInterpreter interpreter = createInterpreter(scriptContent); FilePath scriptFile = interpreter.createScriptFile(workspace); List<String> args = new ArrayList<>(Arrays.asList(interpreter.buildCommandLine(scriptFile))); args.addAll(command.getParameters()); return args; }
private int executeScriptContent(@Nonnull FilePath scriptExecutionRoot, @Nonnull String scriptContent, @Nonnull Map<String, String> scriptExecutionEnvVars) throws EnvInjectException { try { CommandInterpreter batchRunner; if (launcher.isUnix()) { batchRunner = new Shell(scriptContent); } else { batchRunner = new BatchFile(scriptContent); } FilePath tmpFile = batchRunner.createScriptFile(scriptExecutionRoot); logger.info(String.format("Executing and processing the following script content: %n%s%n", scriptContent)); int cmdCode = launcher.launch().cmds(batchRunner.buildCommandLine(tmpFile)).stdout(launcher.getListener()) .envs(scriptExecutionEnvVars).pwd(scriptExecutionRoot).join(); if (cmdCode != 0) { logger.info(String.format("Script executed. The exit code is %s.", cmdCode)); } else { logger.info("Script executed successfully."); } return cmdCode; } catch (IOException ioe) { throw new EnvInjectException("Error occurs on execution script file path", ioe); } catch (InterruptedException ie) { throw new EnvInjectException("Error occurs on execution script file path", ie); } }
envVars.put(e.getKey(),e.getValue()); r = launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).join(); } catch (IOException e) { Util.displayIOException(e,listener);
envVars.put(e.getKey(),e.getValue()); r = launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).join(); } catch (IOException e) { Util.displayIOException(e,listener);
envVars.put(e.getKey(),e.getValue()); r = launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).join(); } catch (IOException e) { Util.displayIOException(e,listener);
r = launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).join(); } catch (IOException e) { Util.displayIOException(e, listener);
envVars.put(e.getKey(),e.getValue()); r = join(launcher.launch().cmds(buildCommandLine(script)).envs(envVars).stdout(listener).pwd(ws).start());
final String[] cmd = batchRunner.buildCommandLine(tmpFile);