简体   繁体   English

如何将文件作为参数从不同的机器传递给jenkins

[英]How to pass file as parameter to jenkins from different machines

I want to pass File as parameter in Jenkins. 我想在Jenkins中将File作为参数传递。 I would like to trigger the Jenkins build from remote machine and upload the file from remote machine and I am expecting Jenkins to pick the file from same machine. 我想从远程计算机触发Jenkins构建并从远程计算机上载文件,我希望Jenkins从同一计算机上选择文件。

But, when I tried to upload a file remote machines, it is always look up to Jenknins WorkSpace instead of taking uploaded file from remote machine. 但是,当我尝试上载文件到远程计算机时,它总是仰赖Jenknins WorkSpace,而不是从远程计算机上获取文件。

Is there any way to configure Jenkins, it has to take same file which I have uploaded from remote machine? 有什么方法可以配置Jenkins,它必须获取我从远程计算机上传的文件吗?

I want to upload my testng.xml file from remote machines to run the scripts. 我想从远程机器上载我的testng.xml文件以运行脚本。

Screenshot1 屏幕截图1

Screenshot2 屏幕截图2

Simply putting the file name of your file in the parameter won't lead to its usage during execution. 只需将文件的文件名放在参数中就不会导致其在执行期间的使用。 It will just copy it in current directory of workspace and could be ignored during your build. 它只会将其复制到工作空间的当前目录中,并且在构建过程中可能会被忽略。

In the File location parameter, specify the relative path where you want to place this file so that it can used as intended. 在“ File location参数中,指定要放置此文件的相对路径,以便可以按预期使用它。

Update your configuration as follows: 如下更新您的配置: 相对路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM