Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Duse-jenkins-bom
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.54</version>
<version>4.4</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -64,7 +64,7 @@
<properties>
<revision>2.36</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.176.1</jenkins.version>
<jenkins.version>2.248</jenkins.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I guess because of the new interface there is no way to get things working on older versions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it uses a new core type that was added in this core release. But the feature supported here is only available starting with this core release anyway, so that's not a problem.

Supporting older baselines in this plugin might require backports etc. though, so I can understand if you want to hold off the merge for a bit longer.

<java.level>8</java.level>
<useBeta>true</useBeta>
<workflow-step-api-plugin.version>2.20</workflow-step-api-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import hudson.init.Terminator;
import hudson.model.Node;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.remoting.Channel;
import hudson.remoting.ChannelClosedException;
Expand All @@ -61,6 +62,7 @@
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import jenkins.model.Jenkins;
import jenkins.tasks.filters.EnvVarsFilterableBuilder;
import jenkins.util.Timer;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -96,7 +98,7 @@
* When the process exits, the status code is also written to a file and ultimately results in the step passing or failing.
* <p>Tasks can also be run on the master node, which differs only in that there is no possibility of a network failure.
*/
public abstract class DurableTaskStep extends Step {
public abstract class DurableTaskStep extends Step implements EnvVarsFilterableBuilder {

private static final Logger LOGGER = Logger.getLogger(DurableTaskStep.class.getName());

Expand Down Expand Up @@ -312,6 +314,7 @@ static final class Execution extends AbstractStepExecutionImpl implements Runnab
durableTask.defaultCharset();
}
Launcher launcher = context.get(Launcher.class);
launcher.prepareFilterRules(context.get(Run.class), step);
LOGGER.log(Level.FINE, "launching task against {0} using {1}", new Object[] {ws.getChannel(), launcher});
try {
controller = durableTask.launch(context.get(EnvVars.class), ws, launcher, listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ private final class PlaceholderExecutable implements ContinuableExecutable, Acce
FilePath workspace = lease.path;
// Cf. AbstractBuild.getEnvironment:
env.put("WORKSPACE", workspace.getRemote());
if (workspace.getParent() != null) {
env.put("WORKSPACE_TMP", WorkspaceList.tempDir(workspace).getRemote()); // JENKINS-60634
final FilePath tempDir = WorkspaceList.tempDir(workspace);
if (tempDir != null) {
env.put("WORKSPACE_TMP", tempDir.getRemote()); // JENKINS-60634
}
FlowNode flowNode = context.get(FlowNode.class);
if (flowNode != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public boolean start() throws Exception {
getContext().get(TaskListener.class).getLogger().println("Running in " + workspace);
Map<String, String> env = new HashMap<>();
env.put("WORKSPACE", workspace.getRemote());
if (workspace.getParent() != null) {
env.put("WORKSPACE_TMP", WorkspaceList.tempDir(workspace).getRemote());
final FilePath tempDir = WorkspaceList.tempDir(workspace);
if (tempDir != null) {
env.put("WORKSPACE_TMP", tempDir.getRemote());
}
getContext().newBodyInvoker()
.withContexts(
Expand Down