Skip to content

Commit

Permalink
Revert "Replace the default node launcher (#853)" (#890)
Browse files Browse the repository at this point in the history
This reverts commit df4b45d.
  • Loading branch information
yahavi authored Oct 2, 2023
1 parent 3fe6b5b commit 0b4c5b8
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/main/java/org/jfrog/hudson/pipeline/common/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,20 +266,15 @@ public String call() throws IOException {
/**
* Launch a process. Throw a RuntimeException in case of an error.
*
* @param taskName - The task name - Maven, Gradle, npm, etc.
* @param nodeLauncher - The default launcher from the node
* @param args - The arguments
* @param env - Task environment
* @param listener - Task listener
* @param ws - The workspace
* @param taskName - The task name - Maven, Gradle, npm, etc.
* @param launcher - The launcher
* @param args - The arguments
* @param env - Task environment
* @param listener - Task listener
* @param ws - The workspace
*/
public static void launch(String taskName, Launcher nodeLauncher, ArgumentListBuilder args, EnvVars env, TaskListener listener, FilePath ws) {
public static void launch(String taskName, Launcher launcher, ArgumentListBuilder args, EnvVars env, TaskListener listener, FilePath ws) {
try {
// Creating default remote launcher irrespective of any type of node.
// Using the default launcher from the node is causing intermittent hangs, depending on the node type and the plugin using to launch that node.
Node node = ActionableHelper.getNode(nodeLauncher);
Launcher launcher = node.createLauncher(listener);

int exitValue = launcher.launch().cmds(args).envs(env).stdout(listener).stderr(listener.getLogger()).pwd(ws).join();
if (exitValue != 0) {
throw new RuntimeException(taskName + " build failed with exit code " + exitValue);
Expand Down Expand Up @@ -423,7 +418,7 @@ public static void addParentBuildProps(ArrayListMultimap<String, String> propert
properties.put(BuildInfoFields.BUILD_PARENT_NAME, ExtractorUtils.sanitizeBuildName(buildName));
Integer buildNumber = ActionableHelper.getUpstreamBuild(build);
if (buildNumber != null) {
properties.put(BuildInfoFields.BUILD_PARENT_NUMBER, buildNumber + "");
properties.put(BuildInfoFields.BUILD_PARENT_NUMBER, buildNumber+ "");
}
}

Expand Down

0 comments on commit 0b4c5b8

Please sign in to comment.