job dsl does not respect pipeline withEnv

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      I expected the following to create an environmental variable named GIT_COMMIT to be available within the scope of the jobs.groovy file:

      withEnv(["GIT_COMMIT=foo"]) {
              jobDsl additionalClasspath: 'jobs/src/main/groovy', removedJobAction: 'DELETE', removedViewAction: 'DELETE', targets: 'jobs/jobs/jobs.groovy', unstableOnDeprecation: true
          }
      

      Instead I get an error:

      No such property: GIT_COMMIT for class: jobs
      

            Assignee:
            Daniel Spilker
            Reporter:
            eamonn faherty
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: