Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42753

Generate runtime model directly from AST model

    XMLWordPrintable

    Details

    • Epic Link:
    • Sprint:
      Declarative - 1.2
    • Similar Issues:

      Description

      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.

       

       

        Attachments

          Issue Links

            Activity

            jedavis Jason Davis created issue -
            jedavis Jason Davis made changes -
            Field Original Value New Value
            Description 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.  I had something like this:
            {noformat}
            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)...'
                    }
                }
            }{noformat}
            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.

             

             
            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:
            {noformat}
            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)...'
                    }
                }
            }{noformat}
            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.

             

             
            jedavis Jason Davis made changes -
            Summary Using a Pipeline Property an Agent Label? Using a Pipeline Property with an Agent Label?
            abayer Andrew Bayer made changes -
            Summary Using a Pipeline Property with an Agent Label? Generate runtime model directly from AST model
            Issue Type Bug [ 1 ] Improvement [ 4 ]
            Priority Minor [ 4 ] Critical [ 2 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #140 (Web Link)" [ 15720 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-42777 [ JENKINS-42777 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-42829 [ JENKINS-42829 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Labels declarative-variable-and-method-resolution
            jamesdumay James Dumay made changes -
            Sprint Declarative - 1.2 [ 366 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Sprint Declarative - 1.2 [ 366 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            abayer Andrew Bayer made changes -
            Sprint Declarative - 1.2 [ 366 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-45916 [ JENKINS-45916 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-45637 [ JENKINS-45637 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-45636 [ JENKINS-45636 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-44603 [ JENKINS-44603 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-44482 [ JENKINS-44482 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-44298 [ JENKINS-44298 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-43035 [ JENKINS-43035 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-42281 [ JENKINS-42281 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-44034 [ JENKINS-44034 ]
            abayer Andrew Bayer made changes -
            Epic Link JENKINS-45422 [ 183590 ]
            abayer Andrew Bayer made changes -
            Link This issue is blocking JENKINS-45991 [ JENKINS-45991 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-46103 [ JENKINS-46103 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            abayer Andrew Bayer made changes -
            Link This issue relates to JENKINS-46112 [ JENKINS-46112 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                jedavis Jason Davis
              • Votes:
                5 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: