-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Critical
-
Component/s: pipeline-model-definition-plugin
-
Declarative - 1.2
My apologies if this isn't a bug, but I've searched high and low and tried a number of things, but I can't seem to find the syntax ex. to solve what's broken. Â After upgrading pipeline plugins to the latest releases (as of today), my declarative pipelines broke because it seems there might no longer be ability to use a property in the agent label. Â This was working:
pipeline{
parameters {
choice(choices: 'server-cd\server-demo', description: DeployEnvironmentHelp, name: 'Environment')
}
environment {
DEPLOYENVIRONMENT = "${params.Environment}"
}
agent none
stages {
stage ("Stage 1") {
agent {label DEPLOYENVIRONMENT}
echo 'Get Deployment Helper Files from SCM repo(s)...'
}
}
}
But the pipeline fails saying that the DEPLOYENVIRONMENT is not a proper value (I no longer have the exact message
) Â
As of model def. 1.1.1, is it no longer possible to use an environment variable or property in the agent label? Â btw - I'm setting DEPLOYENVIRONMENT so I can do other tests and not have to keep using params.Environment, but in other pipelines I set properties so that I can define which agent based on properties that change in the pipeline.
Â
Â
- is blocking
-
JENKINS-45916 Path is not getting set correctly in pipeline when there is a variable present
-
- Fixed but Unreleased
-
-
JENKINS-44298 Variables and functions are no longer binding in a when/expression since version 1.1
-
- Closed
-
-
JENKINS-44482 Environment variable replacement on WINDOWS discard backslashes
-
- Closed
-
-
JENKINS-43035 expression does not see imported classes
-
- Closed
-
-
JENKINS-44603 Can't access variables in pipeline environment function parameters
-
- Closed
-
-
JENKINS-45636 Backslashes are not correctly reduced when in environment var with substituted value
-
- Closed
-
-
JENKINS-45637 Environment vars with multiple substitutions are not set
-
- Closed
-
-
JENKINS-44034 GString variables in environment block must use braces
-
- Closed
-
-
JENKINS-42281 Allow appending to the PATH in environment sections
-
- Closed
-
-
JENKINS-45991 Set default value for environment variable when not already set
-
- Closed
-
- relates to
-
JENKINS-42777 Add more Declarative test coverage based on real-world usage
-
- Closed
-
-
JENKINS-46112 Error Signal Description not expandible in Blue Ocean when using Declarative Pipeline and Environment Variables
-
- Closed
-
-
JENKINS-42829 [Regression] Jenkins pipeline start failing in on when/expression clause with custom method call with No such DSL method found among steps
-
- Closed
-
-
JENKINS-46103 Properly restrict which expressions can be passed to credentials(...) in Declarative
-
- Open
-
- links to