jenkinsci / jenkinsci/workflow-durable-task-step-plugin

[JENKINS-40329] Ability to specify a default workspace on all nodes

Open
#506 1 comment 0 reactions 0 assignees View on GitHub
component:workflow-durable-task-step-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
46
Forks
110
PR merge metrics
No merged PRs in 30d

Description

It would be great if I had the ability to define a default workspace location for all nodes inside my pipeline.

Example:

I want to specify a default workspace for all nodes inside my pipeline. If I want to do this, I need to wrap the same kind of snippet for each node. For example:

    node ('A') {

dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

node ('B') {
dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

node ('C') {
dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

[...]

This is redundant. The same applies to the `ws` step.

---
Originally reported by allan_burdajewicz, imported from: Ability to specify a default workspace on all nodes


  • status: Open
  • priority: Minor
  • component(s): workflow-durable-task-step-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251212-090250

Raw content of original issue

It would be great if I had the ability to define a default workspace location for all nodes inside my pipeline.

Example:

I want to specify a default workspace for all nodes inside my pipeline. If I want to do this, I need to wrap the same kind of snippet for each node. For example:


    node ('A') {

dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

node ('B') {
dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

node ('C') {
dir("${env.BUILD_NUMBER}") {
withEnv(["WORKSPACE=${env.WORKSPACE}/${env.BUILD_NUMBER}"]) {
// ...
}
}
}

[...]


This is redundant. The same applies to the `ws` step.

environment

```
Jenkins 2.19.3

Pipeline 2.4
```

Contributor guide

Open the contributing guide

Research direction

Start by reading the node and ws steps, along with the dir and withEnv usage shown in the issue, to understand how workspace locations are currently selected. Done means a pipeline can define one default workspace location that applies across its nodes and avoids repeating the same wrappers for node and ws.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.