From 0b4c5b87ebc6dd8e4e1fceca663d73598a9eb1de Mon Sep 17 00:00:00 2001 From: Yahav Itzhak Date: Mon, 2 Oct 2023 21:24:12 +0300 Subject: [PATCH] Revert "Replace the default node launcher (#853)" (#890) This reverts commit df4b45de423b3dd3dd237ed32ef4a417721bf405. --- .../jfrog/hudson/pipeline/common/Utils.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/jfrog/hudson/pipeline/common/Utils.java b/src/main/java/org/jfrog/hudson/pipeline/common/Utils.java index d45e98c5b..018c34bd1 100644 --- a/src/main/java/org/jfrog/hudson/pipeline/common/Utils.java +++ b/src/main/java/org/jfrog/hudson/pipeline/common/Utils.java @@ -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); @@ -423,7 +418,7 @@ public static void addParentBuildProps(ArrayListMultimap 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+ ""); } }