简体   繁体   English

使用Java将文件从本地计算机复制到远程计算机时需要帮助

[英]Need help in copying a file from local machine to remote machine using java

I have one csv file in my workspace which i need to copy to another machine where the selenium grid running and so that the test can use it while executing scripts. 我的工作区中有一个csv文件,我需要将其复制到运行硒网格的另一台计算机上,以便测试在执行脚本时可以使用它。 please suggest a way to copy these files? 请提出一种复制这些文件的方法?

有一个本地的Jenkins解决方案,不确定是否需要Java: 存档 cvs文件,然后使用Copy Artifact Plugin将其添加到Selenium作业的WS中。

I think the easiest solution is using dropbox or some service like that. 我认为最简单的解决方案是使用保管箱或类似的服务。 You can copy with an execute shell command to dropbox folder in your jenkins job. 您可以使用execute shell命令将其复制到jenkins作业中的保管箱文件夹中。 And it will automatically synchronize with other machines you installed. 并且它将自动与您安装的其他计算机同步。

cp ~/Home/jobs/YourJob/workspace/yourproject/build/outputs/foo.csv /User/youruser/Dropbox

You can use the new Pipeline Plugin (aka Workflow) and do something like: 您可以使用新的管道插件(也称为工作流)并执行以下操作:

node('master') {
    //stash what ever you need
    stash includes: 'path/to/things/*', name: 'binary'
}


node('selenium') {
   //get it in selenium server
   unstash 'binary'
}

Note: You have to configure 'selenium' as slave 注意:您必须将“ selenium”配置为从属

You can have more information: 您可以了解更多信息:

https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins

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

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