|
9 | 9 | import hudson.model.AbstractBuild; |
10 | 10 | import hudson.model.AbstractProject; |
11 | 11 | import hudson.model.BuildListener; |
12 | | -import hudson.model.Environment; |
| 12 | +import hudson.remoting.Callable; |
13 | 13 | import hudson.tasks.BuildStepDescriptor; |
14 | 14 | import hudson.tasks.Builder; |
15 | 15 | import net.sf.json.JSONObject; |
| 16 | + |
| 17 | +import org.jenkinsci.remoting.RoleChecker; |
16 | 18 | import org.kohsuke.stapler.DataBoundConstructor; |
17 | 19 | import org.kohsuke.stapler.StaplerRequest; |
18 | 20 |
|
19 | 21 | import java.io.IOException; |
20 | 22 | import java.util.HashMap; |
21 | 23 | import java.util.Map; |
22 | | -import java.util.function.Consumer; |
23 | 24 |
|
24 | 25 | public class ExecuteKatalonStudioTask extends Builder { |
25 | 26 |
|
@@ -105,15 +106,25 @@ public boolean perform(AbstractBuild<?, ?> abstractBuild, Launcher launcher, Bui |
105 | 106 | environmentVariables.putAll(System.getenv()); |
106 | 107 | abstractBuild.getEnvironment(buildListener).entrySet() |
107 | 108 | .forEach(entry -> environmentVariables.put(entry.getKey(), entry.getValue())); |
108 | | - return KatalonUtils.executeKatalon( |
109 | | - logger, |
110 | | - this.version, |
111 | | - this.location, |
112 | | - workspaceLocation, |
113 | | - this.executeArgs, |
114 | | - this.x11Display, |
115 | | - this.xvfbConfiguration, |
116 | | - environmentVariables); |
| 109 | + return launcher.getChannel().call(new Callable<Boolean, Exception>() { |
| 110 | + @Override |
| 111 | + public Boolean call() throws Exception { |
| 112 | + return KatalonUtils.executeKatalon( |
| 113 | + logger, |
| 114 | + version, |
| 115 | + location, |
| 116 | + workspaceLocation, |
| 117 | + executeArgs, |
| 118 | + x11Display, |
| 119 | + xvfbConfiguration, |
| 120 | + environmentVariables); |
| 121 | + } |
| 122 | + |
| 123 | + @Override |
| 124 | + public void checkRoles(RoleChecker roleChecker) throws SecurityException { |
| 125 | + |
| 126 | + } |
| 127 | + }); |
117 | 128 | } |
118 | 129 | } |
119 | 130 |
|
|
0 commit comments