詹金斯如何上传文本文件,并使用它作为一个参数 [英] Jenkins How can i upload a text file and use it as a parameter

查看:193
本文介绍了詹金斯如何上传文本文件,并使用它作为一个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个抱着一个字符串中,我希望能够在我的剧本之一来使用此字符串一个txt文件,所以我不知道是否有一种方法来设置文件的内容为一体我就可以在我的脚本中使用生成属性或参数应该是一样使用构建环境属性之一。
例如:$ {} JOB_NAME其持有的作业名称,所以在相同的方式,我想访问其内部保持一定的价值的文件的内容。
这可能吗?

I have a txt file that is holding a string inside, I want to be able to use this string in one of my scripts, so I'm wondering if there is a way to set the content of the file as one of the build properties or parameters which I'll be able to use in my scripts it should be the same as using one of the build environment properties. For example : ${JOB_NAME} which is holding the the job name, so in the same way I want to access the content of the file which is holding some value inside. Is it possible?

推荐答案

您可以从您的电脑通过文件的作业参数上传文件到工作区。

You can upload a file from your computer to the workspace through the File parameter of the job.

您可以使用 扩展插件选择 参数,从文件中读取值(S),并在下拉/单选按钮/复选框显示他们的用户选择,动态的,每次构建被触发的时间。

You can use Extended Choice plugin parameter, to read value(s) from a file and display them in a dropdown/radio-button/checkbox for the user to select, dynamically, every time the build is triggered.

您可以使用 EnvInject插件 从文件中读出的值(多个),并将其注入到构建为环境变量,以便它们可以通过构建步骤/脚本的其余部分使用。

You can use EnvInject plugin to read value(s) from a file and inject them into the build as environment variables, so that they can be used by the rest of the build steps/scripts.

您的问题是什么你正在尝试做的很不清楚。挑选的3种方法之一以上的基础上,你需要什么,或澄清你的问题。

Your question is very unclear on what your are trying to do. Pick one of the 3 methods above based on what you need, or clarify your question.

这篇关于詹金斯如何上传文本文件,并使用它作为一个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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