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

            Hide
            abayer Andrew Bayer added a comment -

            Patrick Wolf So I think input step return values are a different thing than ParameterValue...

            Show
            abayer Andrew Bayer added a comment - Patrick Wolf So I think input step return values are a different thing than ParameterValue ...
            Hide
            abayer Andrew Bayer added a comment -

            Jesse Glick Why don't we have an equivalent to this in WorkflowRun? If we did, we'd pick up ParameterAction contributions automatically...

            Show
            abayer Andrew Bayer added a comment - Jesse Glick Why don't we have an equivalent to this in WorkflowRun ? If we did, we'd pick up ParameterAction contributions automatically...
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
            src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java
            http://jenkins-ci.org/commit/workflow-job-plugin/219fde38743eccc3c91cdd32f3061645583d8314
            Log:
            [FIXED JENKINS-30910] Build environment should include parameters.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java src/test/java/org/jenkinsci/plugins/workflow/job/WorkflowRunTest.java http://jenkins-ci.org/commit/workflow-job-plugin/219fde38743eccc3c91cdd32f3061645583d8314 Log: [FIXED JENKINS-30910] Build environment should include parameters.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/test/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinitionTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/86c7ea988f371a8b50d2a2ed41ad2fcb4cd6de25
            Log:
            [FIXED JENKINS-28447] CpsScmFlowDefinition does not resolve variables.
            Actual fix is implied by JENKINS-30910; this is just the integration test.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/test/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinitionTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/86c7ea988f371a8b50d2a2ed41ad2fcb4cd6de25 Log: [FIXED JENKINS-28447] CpsScmFlowDefinition does not resolve variables. Actual fix is implied by JENKINS-30910 ; this is just the integration test.
            Hide
            wimederveen Wim Ederveen added a comment -

            With the fix in job plugin 2.7 we are able to start a pipeline build while using the choice parameter

            Show
            wimederveen Wim Ederveen added a comment - With the fix in job plugin 2.7 we are able to start a pipeline build while using the choice parameter

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: