To do Web UI Automation, in order to improve efficiency, with more than one Windows node to run automation, but slave-agent every time after the shutdown has to manually start, trouble, online to see a series of said start task, feel or not to consider, here use Windows Scheduled task to complete.
The configuration is as follows:
When disconnected, Jenkins hints that we have two ways to start
We use the second method to open the boot
1.“slave.jar”是一个超链接。 点击下载slave.jar文件
2、windows控制面板--管理工具--任务计划
3、创建一个基本任务
- 向导的第一页:
- 名字:jenkins_agent
- 说明(可选)
- 点击下一步
- 向导的下一页
- 什么时候开始执行任务:选择“当计算机启动时”
- 点击下一步
- 向导的下一页
- 向导的下一页
- 程序/脚本:输入“java.exe”(或java.exe的完整路径)
- 添加参数:输入命令的其余部分,如“-jar slave.jar -jnlpUrl http:// <JenkinsHostName>:8080 / computer / <nodeName> /slave-agent.jnlp -secret <some_long_hex_string>”
- 例如:-jar D:\ Scripts\jenkins\slave.jar -jnlpUrl http://jenkinshost.example.com:8080/computer/buildNode1/slave-agent.jnlp-secret d6a84df1fc4f45ddc9c6ab34b08f13391983ffffffffffb3488b7d5ac77fbc7
- 点击下一步
- 向导的下一页
- 单击完成后单击复选框“打开此任务的属性”对话框
- 单击完成
The Windows node in Jenkins is set to boot from startup Slave-agent