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

查看:139
本文介绍了如何将通用文件上传到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天全站免登陆