jenkinsci / jenkinsci/workflow-durable-task-step-plugin
[JENKINS-40329] Ability to specify a default workspace on all nodes
- 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
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
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