Details
-
Improvement
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
Description
We'd like to set an environment variable for a pipeline job to inherit from a global environment variable when present, but to default to a reasonable value when not. This was possible in scripted pipeline using the following snippet:
def foo = env.FOO ?: 'foo' withEnv(["BAR=${foo}"]) { // build }
My attempts to recreate this in declarative pipelines have proven unsuccessful. If this is already possible, please provide some documentation. If it's not possible, please consider this a feature request.
Attachments
Issue Links
- depends on
-
JENKINS-42753 Generate runtime model directly from AST model
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Labels | declarative-variable-and-method-resolution |
Epic Link |
|
Link |
This issue depends on |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |