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

Job parameters should be exposed as environment variables

      I noticed that job input parameters are not available inside of the sh task
      for example:

      sh 'echo ${ARTIFACTS}'
      

      I'm aware of that I can interpolate the variable but I have scripts which expects to have variables set.

      // expects to have ARTIFACTS env available 
      sh('./some-python-script.py')) 
      

      Migration from my old hand patched pipeline to the new workflow would be easier if Job parameters and injected environment variables are available like in the regular script step (freestyle project)

          [JENKINS-30910] Job parameters should be exposed as environment variables

          Daniel Kuffner created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-29952 [ JENKINS-29952 ]
          Jesse Glick made changes -
          Summary Original: job input parameters should be exposed in sh task New: Job parameters should be exposed as environment variables
          Jesse Glick made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]

          Jesse Glick added a comment -

          Possible in conjunction with JENKINS-29952 and JENKINS-27295, I think: the current flattened parameters could be moved to environment variables, which would like all other env vars be accessible via Groovy as now, and there would be a separate pseudovariable which would give access to typed objects and more.

          Jesse Glick added a comment - Possible in conjunction with JENKINS-29952 and JENKINS-27295 , I think: the current flattened parameters could be moved to environment variables, which would like all other env vars be accessible via Groovy as now, and there would be a separate pseudovariable which would give access to typed objects and more.
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-28447 [ JENKINS-28447 ]
          Patrick Wolf made changes -
          Labels New: followup
          Jesse Glick made changes -
          Epic Link New: JENKINS-35394 [ 171187 ]

          Cameron I added a comment -

          Also related to JENKINS-36528?

          Cameron I added a comment - Also related to JENKINS-36528 ?
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 166037 ] New: JNJira + In-Review [ 182258 ]

            jglick Jesse Glick
            dkuffner Daniel Kuffner
            Votes:
            24 Vote for this issue
            Watchers:
            36 Start watching this issue

              Created:
              Updated:
              Resolved: