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

job dsl does not respect pipeline withEnv

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      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
      

            daspilker Daniel Spilker
            eamonnfaherty eamonn faherty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: