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

Job parameters should be exposed as environment variables

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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)

        Attachments

          Issue Links

            Activity

            dkuffner Daniel Kuffner created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-29952 [ JENKINS-29952 ]
            jglick Jesse Glick made changes -
            Summary job input parameters should be exposed in sh task Job parameters should be exposed as environment variables
            jglick Jesse Glick made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-28447 [ JENKINS-28447 ]
            hrmpw Patrick Wolf made changes -
            Labels followup
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35394 [ 171187 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 166037 ] JNJira + In-Review [ 182258 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Assignee Jesse Glick [ jglick ] Andrew Bayer [ abayer ]
            jglick Jesse Glick made changes -
            Assignee Andrew Bayer [ abayer ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Component/s workflow-job-plugin [ 21716 ]
            Component/s workflow-cps-plugin [ 21713 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 24 (Web Link)" [ 14841 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: