How to save uploaded file under original file name in Jenkins Parameterized Build "File Parameter"?
相关问题
- Jenkins - cmd is not recognized
- Upload file to Google Cloud Storage using AngularJ
- Pass code to a method as an argument
- When using Nokogiri, how do you suppress the inser
- Where Jenkins stores plugin configuration
相关文章
- dotnet restore还原nuget包时无法加载 https://api.nuget.org/
- jenkins在window集群环境中如何部署自动化发布?
- jenkins + Publish over FTP 自动部署前端React项目
- jenkins自定打包部署React前端项目遇到的问题。
- Best way to manage docker containers with supervis
- Access BitBucket payload data in Jenkins pipeline
- How can I convert a PHP function's parameter l
- Jenkins Not Outputting Junit Report Info From File
You can get original file name from the parameter with the same name as the parameter name (file location field).
For example if the file location is
my_file
then you can rename it to original by executing:The "File" Parameter of the Jenkins Parameterized Build always gets the same name in your job.
We were able to sort-of-bypass this by specifying two parameters:
In our script, we took the file as we got it via the first parameter,
then renamed it as the second.
(the user had to Paste the same value to both of the fields...)
UPDATE:
As mentioned by Nux (and James Ruskin), this issue was resolved around 2011,
so you now have the ability to access the original file, in the following way:
If, for example, your File-Parameter is named File1,
then your script gets the content of that file in
File1
and it can access the original file by using the local parameter
${File1}
.I suspect it gets tricky when the script and the user are not on the same OS,
i.e.: the user writes a path in Windows and the script runs on a Unix