简体   繁体   English

如何在Jenkins CI从节点上运行robotframework作业

[英]How to run a robotframework job on a Jenkins CI slave node

I have already setup the jenkins master and slave using the java web app as advised and I am using the Jenkins master on Windows 7 and the slave on windows Vista , the question now being how to have a simple job run on the slave as part of the masters build process. 我已经按照建议使用Java Web应用程序设置了jenkins主服务器和从属服务器,并且在Windows 7上使用了Jenkins主服务器,在Windows Vista上使用了从属服务器,现在的问题是如何在从属服务器上运行简单的作业,作为大师们的建造过程。
The job that has to be run on the slave is a robotframework test script. 必须在从属服务器上运行的作业是robotframework测试脚本。
Please be clear that the connection is already established between the master and the slave. 请注意,主站和从站之间已经建立了连接。 该图显示了彼此检测到的主机和从机
Even if we forget this whole scenario how can we run a simple "echo "Hello World "" script on the slave. 即使我们忘记了整个场景,也如何在从属服务器上运行简单的“ echo“ Hello World”“脚本。
Even when we browse the slave through the standard jenkins interface there is no option which says make a remote job, Ofcourse there is a Remote Parameterized build but no server shows up in the configuration(which begs the question am I doing it right ) but as I have already configured another machine as a slave I think it is quite right that the name does not show up in the Server tab... 即使当我们通过标准的jenkins界面浏览从站时,也没有选项表明执行远程作业,当然有远程参数化的版本,但是配置中没有服务器显示(这是我做对的问题),但是我已经将另一台机器配置为从机,我认为名称没有显示在“服务器”选项卡中是完全正确的...
This is the image for the remote parameterized build part 这是远程参数化构建部件的图像
该图像显示也不可以输入任何内容,或者提示oF Server不显示任何其他IP地址

In Jenkins job configuration there should be a checkbox "Restrict where this project can be run". 在Jenkins作业配置中,应该有一个复选框“限制可以在哪里运行该项目”。 Select it and type your Jenkins slaves name "Toshiba" into textbox under it. 选择它,然后在其下方的文本框中键入您的Jenkins奴隶名称“ Toshiba”。 This forces Jenkins to run jobs only on it. 这迫使詹金斯只能在上面工作。

Better solution would be to add "robot" label to this slave and use it as restriction in job. 更好的解决方案是在此从属服务器上添加“机器人”标签,并将其用作作业限制。 You may later add more Robot Framework jobs and find that this one slave is not enough. 您稍后可能会添加更多的Robot Framework作业,并发现仅此一个奴隶是不够的。 If you then add more slaves and label them as "robot", Jenkins would choose an available slave. 如果您随后添加更多从站并将其标记为“机器人”,则詹金斯会选择一个可用的从站。

Update: 更新:

So you want to run make command on master and pybot on slave. 所以你想在master和pybot上运行make命令。 In Jenkins you can run one job only in one host. 在Jenkins中,您只能在一个主机中运行一项作业。 This means you must have two jobs: make and robot. 这意味着您必须完成两项工作:make和robot。 Usually they look something like this: 通常他们看起来像这样:

Make 使

  • Get sources from version control 从版本控制获取源
  • Make 使
  • Save built binaries as artefacts 将生成的二进制文件另存为人工制品
  • Trigger Robot job 触发机器人工作

Robot 机器人

  • Use Build after other projects are built to trigger start of this job. 在构建其他项目之后使用Build来触发此作业的开始。 Specify Make build as project to watch 将Make build指定为要观看的项目
  • Get Robot test code from version control 从版本控制获取机器人测试代码
  • Copy built binaries from Make job (=artefacts) 从Make job复制复制的二进制文件(= artifacts)
  • Install binaries 安装二进制文件
  • Run tests 运行测试
  • Publish results 发布结果

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

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