Jenkins中不推荐使用JNLP Connections,将Windows从站连接到jenkins的新推荐方法是什么? [英] JNLP Connections are deprecated in Jenkins what is the new recommended way connecting a windows slave to jenkins?
问题描述
由于标题已经声明不赞成使用JNLP连接,Jenkins还提供了一条消息和一个超链接到
As the Title already states JNLP Connections are Deprecated Jenkins also gives a Message and a Hyperlink to
https://en.wikipedia.org/wiki/Java_Web_Start#Deprecation
那么现在将Windows Slave附加到Jenkins的推荐方法是什么,在 https://jenkins上似乎没有真正好的指南.io 涵盖了该主题.
So whats now the recommended way attaching a Windows Slave to Jenkins, there seems to be no real good guide on https://jenkins.io covering that topic.
推荐答案
有一个名为 OpenWebStart 的开源替代软件,它基于
There is an open source replacement called OpenWebStart which is based on IcedTeaWeb.
更多信息:
OpenWebStart是WebStart和JNLP的开源实现
标准(JSR-56).
OpenWebStart is an open source implementation of the WebStart and JNLP
standards (JSR-56). [...] 在IcedTeaWeb中,我们目前正在映射JNLP规范,
在最大程度上支持其功能.此外
到以IcedTeaWeb为核心的OpenWebStart,IcedTeaWeb也是
在AdoptOpenJDK中使用,以在Java 8中提供最少的WebStart
发布的AdoptOpenJDK.但是,与
OpenWebStart,因为他们只能使用当前的JVM来运行
基于JNLP的应用程序. In IcedTeaWeb we are currently working on mapping the JNLP spec and
supporting its functions to the greatest extent possible. In addition
to OpenWebStart, which uses IcedTeaWeb as its core, IcedTeaWeb is also
used within AdoptOpenJDK to provide minimal WebStart in the Java 8
releases of AdoptOpenJDK. However, these are limited compared to
OpenWebStart because they can only use the current JVM to run
JNLP-based applications.
使用
When installing Jenkins service from the command-line using 步骤(假设您已经在Jenkins master中设置了节点): Steps (assuming you have already set up the node in Jenkins master): 在同一目录中创建"jenkins-slave.xml": Create "jenkins-slave.xml" in the same directory:
创建"jenkins-slave.exe.conf"文件,以防止可执行文件在.NET Framework的早期版本上运行. Create "jenkins-slave.exe.conf" file to prevent the executable from running on an earlier version of the .NET Framework. 以管理员身份启动"cmd.exe",并导航到"jenkins-slave.exe"目录. Launch "cmd.exe" as administrator and navigate to directory of "jenkins-slave.exe". 这篇关于Jenkins中不推荐使用JNLP Connections,将Windows从站连接到jenkins的新推荐方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
使用Jenkins服务的命令行安装摆脱Java Web Start
jenkins-slave.exe
(又名winsw-*.exe
)从命令行安装Jenkins服务时,不再需要Java Web Start.似乎JNLP协议仍在幕后使用,因此将来可能仍然存在过时的问题.Get rid of Java Web Start using command-line installation of Jenkins service
jenkins-slave.exe
(aka winsw-*.exe
), Java Web Start is no longer required. It seems that JNLP protocol is still used behind the scenes, so it may still have some deprecation issue in the future.
将其放在自定义WorkDir"路径中,并将其重命名为"jenkins-slave.exe" http://YourJenkinsServer:8080/jnlpJars/agent.jar
将其放在自定义WorkDir"路径中,并将其重命名为"slave.jar"
Place it in the Custom WorkDir path and rename it to "jenkins-slave.exe"http://YourJenkinsServer:8080/jnlpJars/agent.jar
Place it in the Custom WorkDir path and rename it to "slave.jar"<service>
<id>YourJenkinsSlaveServiceId</id>
<name>Your Jenkins Slave Service Name</name>
<description>This service runs an agent for Jenkins automation server.</description>
<executable>C:\Program Files\Java\JRE8\bin\java.exe</executable>
<arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl http://YourJenkinsServer:8080/computer/YourNodeName/slave-agent.jnlp -secret YourSecretStringConsistingOfHexadecimalCharacters -workDir=C:\YourNodeWorkDir</arguments>
<logmode>rotate</logmode>
<onfailure action="restart" />
<download from="http://YourJenkinsServer:8080/jnlpJars/agent.jar" to="%BASE%\slave.jar"/>
<extensions>
<extension enabled="true" className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" id="killOnStartup">
<pidfile>%BASE%\jenkins_agent.pid</pidfile>
<stopTimeout>5000</stopTimeout>
<stopParentFirst>false</stopParentFirst>
</extension>
</extensions>
</service>
http://YourJenkinsServer:8080/computer/YourNodeName/
).
官方文档 http://YourJenkinsServer:8080/computer/YourNodeName/
).
Official documentation<configuration>
<startup>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>