我正在尝试找到一种方法来提示用户在构建之前选择通用文件并将其从本地计算机上传到 Jenkins 作业。用户要上传的输入文件不一定是文本或属性文件。
我特别试图让用户“选择”他们想要的文件 - 浏览到他们的文件;用户不应传递文件的路径。
谢谢
最佳答案
使用文件参数:
File parameter allows a build to accept a file, to be submitted by the user when scheduling a new build. The file will be placed inside the workspace at the known location after the check-out/update is done, so that your build scripts can use this file.
如果您需要验证文件是否具有特定扩展名,则必须使用脚本作为工作的一部分来执行此操作,并且如果扩展名/内容类型与您需要的不匹配,则工作会失败。
关于jenkins - 如何将通用文件上传到 Jenkins 作业中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27491789/