Home > Back-end >  Is there a way to get file name from file parameter for Jenkins build
Is there a way to get file name from file parameter for Jenkins build

Time:07-22

I have a freestyle Jenkins job that has a file parameter. To build the job someone has to go in on their local and select the file they would like to use. I'm running an execute shell build and I was wondering if there is anyway to get the original name of the file uploaded. I watched this youtube video: https://www.youtube.com/watch?v=-4iMrktR4ZQ&t=632s. And they were able to get the path, but they are you using windows batch command, not execute shell.

CodePudding user response:

Yes you should be able the access the values selected with the Parameter name that you give. You can use $PARAM_NAME to get it within your Shell step.

  • Related