-
Bug
-
Resolution: Fixed
-
Minor
I'm trying to access "BRANCH_NAME" variable in "TEST" pipeline environment function parameters:
@Library('manala') _ pipeline { agent { docker 'manala/hugo' } environment { TEST = manalaDomainize("${env.BRANCH_NAME}") } stages { stage('Test') { steps { sh "echo $TEST" } } } }
This breaks the build, returning:
groovy.lang.MissingPropertyException: No such property: TEST for class: groovy.lang.Binding
Without success, i've tried different syntaxes:
TEST = manalaDomainize("$BRANCH_NAME") TEST = manalaDomainize("${BRANCH_NAME}") TEST = manalaDomainize("${env.BRANCH_NAME}") TEST = manalaDomainize(env.BRANCH_NAME) TEST = manalaDomainize(BRANCH_NAME)
Of course, manalaDomainize() is a valid function, and everything is ok when i provide a simple string such as "foo".
- depends on
-
JENKINS-42753 Generate runtime model directly from AST model
-
- Closed
-
[JENKINS-44603] Can't access variables in pipeline environment function parameters
Component/s | New: pipeline-model-definition-plugin [ 21706 ] | |
Component/s | Original: pipeline [ 21692 ] |
Assignee | New: Andrew Bayer [ abayer ] |
Labels | New: declarative-variable-and-method-resolution |
Epic Link |
New:
|
What release of Declarative are you using?