Details

    • Similar Issues:

      Description

      JENKINS-27295 discusses getting values from various kinds of parameters. Handling FileParameterValue is another matter. buildEnvironment (what is called today) is useless since it gives only a file name. createBuildWrapper is the way this works in a freestyle project, but this cannot work in a workflow; even if it were to return a SimpleBuildWrapper (JENKINS-24673) it is not clear where that would be called, since we can only use it from a workspace. getValue as currently implemented is useless since a FileItem does not have whitelisted methods, and anyway we would not want the flow itself to be copying streams to the workspace; this needs to be done by infrastructure. The only way forward I can see at the moment is for getValue to return a SimpleBuildWrapper, so that your flow could read

      node {
        wrap([$delegate: parameters.myFileParam]) {
          sh 'cat myFileParam'
        }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            janvrany Jan Vrany added a comment -

            Just a notice:
            I have moved my workaround library with `unstashParam` step to GitHub, new locations is

            https://github.com/janvrany/jenkinsci-unstashParam-library

            I also renamed it as this issue seems to be unlikely "fixed".

            Show
            janvrany Jan Vrany added a comment - Just a notice: I have moved my workaround library with `unstashParam` step to GitHub, new locations is https://github.com/janvrany/jenkinsci-unstashParam-library I also renamed it as this issue seems to be unlikely "fixed".
            Hide
            vinwin Vin Win added a comment -

            Hi James Hogarth - Does the solution works for binary/zip file. Tried using groovy script & respective one on Jenkins pipleline, but it doesn't seem to work for zip (Can not open file 'fileName.zip' as archive') or binary file uploaded. Would like to know if this is been considered in future releases ?

            Show
            vinwin Vin Win added a comment - Hi James Hogarth - Does the solution works for binary/zip file. Tried using groovy script & respective one on Jenkins pipleline, but it doesn't seem to work for zip (Can not open file 'fileName.zip' as archive') or binary file uploaded. Would like to know if this is been considered in future releases ?
            Hide
            sharpep_trw Paul Sharpe added a comment -

            Vin Win: The unstashParam workaround works great for us, including zip files. We are using a windows instance of Jenkins (in case that is significant).

            Show
            sharpep_trw Paul Sharpe added a comment - Vin Win : The unstashParam workaround works great for us, including zip files. We are using a windows instance of Jenkins (in case that is significant).
            Hide
            schmandr Andreas Schmid added a comment -

            I don't quite understand if this is just not implemented yet, or if it's impossible to implement at all. If it is possible, we might be able to fund the development of this feature, as we need it too. As I am still rather new to the Jenkins community: Can anyone recommend me any companies that could do that?

             

            Show
            schmandr Andreas Schmid added a comment - I don't quite understand if this is just not implemented yet, or if it's impossible to implement at all. If it is possible, we might be able to fund the development of this feature, as we need it too. As I am still rather new to the Jenkins community: Can anyone recommend me any companies that could do that?  
            Hide
            jglick Jesse Glick added a comment -

            Andreas Schmid as to technical design, see my comments of 2018-10-24 and 2019-06-21. I am interpreting the requirement more broadly than the original statement: a user or script should be able to trigger a Pipeline job with a build parameter that includes the contents of a (possibly large, possibly binary, but not secret) file, using any common mechanism (GUI, HTTP POST, build-job CLI command, build step), in such a way that some convenient (Scripted and/or Declarative) syntax may be used to retrieve that file in a designated workspace location at a designated time, including in future rebuilds.

            Show
            jglick Jesse Glick added a comment - Andreas Schmid as to technical design, see my comments of 2018-10-24 and 2019-06-21. I am interpreting the requirement more broadly than the original statement: a user or script should be able to trigger a Pipeline job with a build parameter that includes the contents of a (possibly large, possibly binary, but not secret) file, using any common mechanism (GUI, HTTP POST, build-job CLI command, build step), in such a way that some convenient (Scripted and/or Declarative) syntax may be used to retrieve that file in a designated workspace location at a designated time, including in future rebuilds.

              People

              • Assignee:
                Unassigned
                Reporter:
                jglick Jesse Glick
              • Votes:
                110 Vote for this issue
                Watchers:
                116 Start watching this issue

                Dates

                • Created:
                  Updated: