如何将通用文件上传到 Jenkins 作业中? [英] How to upload a generic file into a Jenkins job?

查看:43
本文介绍了如何将通用文件上传到 Jenkins 作业中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种方法来提示用户在构建之前从本地机器选择和上传通用文件到 Jenkins 作业.用户要上传的输入文件不一定是文本或属性文件.

I am trying to find a way to prompt the user to select and upload a generic file from a local machine to a Jenkins job prior to build. The input file that user is going to upload is not necessarily a text or a property file.

我特别想让用户选择"他们想要的文件 - 浏览到他们的文件;用户不应传递文件的路径.

I am specifically trying to get the user to "select" their desired file - browse to their file ; the user should not pass the file's path.

谢谢

推荐答案

使用文件参数:

File 参数允许构建接受文件,在安排新构建时由用户提交.签出/更新完成后,该文件将放置在工作区中的已知位置,以便您的构建脚本可以使用该文件.

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.

如果您需要验证文件是否具有特定扩展名,您必须在工作中使用脚本来执行此操作,如果扩展名/内容类型与您需要的不匹配,则该工作将失败.

If you need to verify the file has a certain extension, you would have to do that with a script as part of your job, and fail the job is extension/content-type does not match what you need.

这篇关于如何将通用文件上传到 Jenkins 作业中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆