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

Environment variables can't be used in agent configuration

      If you try something like

      agent {
        label "${SOME_ENV_VAR}"
      }
      environment {
        SOME_ENV_VAR = "some-label"
      }
      

      You'll get an error due to SOME_ENV_VAR not existing in the binding. Not ideal, obviously, but I'm not sure if we can actually solve this without significant rewrites.

          [JENKINS-43911] Environment variables can't be used in agent configuration

          Andrew Bayer created issue -
          Andrew Bayer made changes -
          Labels New: declarative-variable-and-method-resolution
          James Dumay made changes -
          Epic Link New: JENKINS-45422 [ 183590 ]
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "PR #189 (Web Link)" [ 17613 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andrew Bayer made changes -
          Link New: This issue is duplicated by JENKINS-44352 [ JENKINS-44352 ]
          Andrew Bayer made changes -
          Link New: This issue is duplicated by JENKINS-46525 [ JENKINS-46525 ]
          Andrew Bayer made changes -
          Status Original: In Review [ 10005 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Labels Original: declarative-variable-and-method-resolution New: declarative-variable-and-method-resolution triaged-2018-11
          Liam Newman made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]

            Unassigned Unassigned
            abayer Andrew Bayer
            Votes:
            22 Vote for this issue
            Watchers:
            32 Start watching this issue

              Created:
              Updated: