jenkins - 如何将通用文件上传到 Jenkins 作业中?

标签 jenkins jenkins-plugins

我正在尝试找到一种方法来提示用户在构建之前选择通用文件并将其从本地计算机上传到 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.

enter image description here

如果您需要验证文件是否具有特定扩展名,则必须使用脚本作为工作的一部分来执行此操作,并且如果扩展名/内容类型与您需要的不匹配,则工作会失败。

关于jenkins - 如何将通用文件上传到 Jenkins 作业中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27491789/

相关文章:

c# - .Net Core 忽略环境变量 DOTNET_SKIP_FIRST_TIME_EXPERIENCE

jenkins - Cypress 有时会卡在 Jenkins 身上

java - JENKINS : Can not set org. eclipse.aether.spi.log.Logger 字段 org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider.logger

jenkins-pipeline - 如何在Jenkins声明性管道代码中使用Validating String Parameter Plugin?

docker - 无法使用Jenkins CloudFoundryPlugin将Docker镜像推送到Cloud Foundry

docker - 嵌套的docker设置:子代公开父代

Jenkins 管道 emailext emailextrecipients : Can I also add specific, 个人电子邮件地址?

jenkins - 在 Jenkinsfile 失败中获取错误原因

jenkins - Gradle脚本作为Jenkins发布后的操作

node.js - Jenkins NodeJS 插件 : can't execute 'node'