[英]Jenkins: Windows slave, linux master, how to configure (ant) build tools properly?
I have a jenkins 1.5XX master node running on centos/linux that builds java stuff with maven and ant. 我有一个在centos / linux上运行的jenkins 1.5XX主节点,用maven和ant构建java东西。 It works perfectly for a long time. 它很长时间都很完美。
Now I want to add a Windows slave to build C++ windows programs and stuff. 现在我想添加一个Windows slave来构建C ++ windows程序和东西。 They were previously built on a separate jenkins server but it died and I lost everything. 它们之前是在一个单独的jenkins服务器上构建的,但它已经死了,我丢失了一切。
I created a windows VM and managed to setup a slave node on the vm with the doc provided in the jenkins wiki . 我创建了一个Windows VM,并设法使用jenkins wiki中提供的doc在vm上设置一个从节点。 The node/jenkins windows service works. 节点/ jenkins Windows服务工作。
I created a Job to be runned on the windows slave and tied it to the slave via the config. 我创建了一个在Windows slave上运行的Job,并通过config将它绑定到slave。 It works since I see Building remotely on bld2-windows in workspace C:\\Software\\Jenkins\\workspace\\mgmt
. 它工作,因为我看到Building remotely on bld2-windows in workspace C:\\Software\\Jenkins\\workspace\\mgmt
。
My Ant installations are defined in the global properties and are working and existing on the linux node. 我的Ant安装在全局属性中定义,并且在linux节点上正在工作和存在。
In the windows node config I defined "Tool Locations" for the Ant installation and targeted a valid Ant install on the windows xp server: "Home = C:\\Software\\Liberty\\ant" 在Windows节点配置中,我为Ant安装定义了“工具位置”,并在Windows xp服务器上定位了有效的Ant安装:“Home = C:\\ Software \\ Liberty \\ ant”
Although, it crashes after the checkout with the error msg: FATAL: Cannot find executable from the chosen Ant installation
虽然,它在结帐后崩溃并出现错误消息: FATAL: Cannot find executable from the chosen Ant installation
The problem was that the path and ANT_HOME
were not properly configured on the windows node. 问题是在Windows节点上没有正确配置路径和ANT_HOME
。 in order to fix this, in windows, go to "My Computer" > "Properties" > "Advanced" > "Environment Variables"
and define ANT_HOME
. 为了解决这个问题,在Windows中,转到"My Computer" > "Properties" > "Advanced" > "Environment Variables"
并定义ANT_HOME
。
To test ant install on windows, I suggest you open a cmd prompt and type ant.bat
if it opens ant, you are good. 要在Windows上测试ant安装,我建议你打开一个cmd提示符并输入ant.bat
如果它打开了ant,你很好。
On the jenkins node setup, no need to define any tools location or override anything. 在jenkins节点设置中,无需定义任何工具位置或覆盖任何内容。 Just use ant default in the job config. 只需在作业配置中使用ant default。
I have found that the setup needs to be completed at the node config in order to properly pick up ant, java etc. With these settings properly configured, my builds run fine on the slave. 我发现需要在节点配置中完成设置才能正确获取ant,java等。正确配置这些设置后,我的构建在slave上运行正常。
host:8080/computer/[NODENAME]/configure
Node properties: 节点属性:
List of key-value pairs 键值对列表
name: ANT_HOME value: [Path to ant root] name: JAVA_HOME value: [Path to java (jdk) root] name:PATH value:%PATH%;[Path to ant root]\\bin
Tool Locations 工具位置
Name:(Ant) 1.9.4 Home:[Path to ant root] Name:(JDK) 1.7.0_25 Home:[Path to java (jdk) root]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.