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
            fr0 Chris Frolik added a comment - - edited

            "I am not particularly inclined to fix this per se"

            That is very disappointing, and a stumbling block for those trying to convert their freestyle jobs to declarative pipeline jobs. I really hope you change your mind on this.

            At the very least, the documentation should mention that it isn't supported.

            Show
            fr0 Chris Frolik added a comment - - edited "I am not particularly inclined to fix this per se" That is very disappointing, and a stumbling block for those trying to convert their freestyle jobs to declarative pipeline jobs. I really hope you change your mind on this. At the very least, the documentation should mention that it isn't supported.
            Hide
            markewaite Mark Waite added a comment -

            Removed from documentation on jenkins.io July 25, 2019 by PR-2388

            Show
            markewaite Mark Waite added a comment - Removed from documentation on jenkins.io July 25, 2019 by PR-2388
            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).

              People

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

                Dates

                • Created:
                  Updated: