简体   繁体   English

Jenkins:Windows slave,linux master,如何正确配置(ant)构建工具?

[英]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.

相关问题 如何配置jenkins主从服务器,其中master在linux上,而slave在Windows机器上 - how to configure jenkins master slave where master is on linux and slave on windows machine 如何在 JENKINS 中从 Linux Master 启动 Windows Slave - How to launch Windows Slave from Linux Master in JENKINS "Jenkins 到 git Windows master \/ Linux slave 的路径" - Jenkins path to git Windows master / Linux slave 无法将 Linux 机器作为从机添加到在 Windows 机器上运行的 Jenkins 主机 - Not able to add Linux machine as Slave to Jenkins master running on Windows machine Jenkins Master和Slave配置Linux到AIX - Jenkins Master and Slave configuration linux to AIX 如何在同一jenkins文件中配置jenkins以在多个节点(一个用于linux,一个用于Windows)上构建? - How to configure jenkins to build on multiple nodes (one for linux and one for windows) in the same jenkins file? 如何构建可以通过 Jenkins master 运行节点基础项目的基于节点的 dockerized jenkins-slave - how to build node based dockerized jenkins-slave that can run the node base project through Jenkins master SSH 从 windows Jenkins 从属到 ZEDC9F0A5A5D57797BF68E37364743831 - SSH from windows Jenkins slave to Linux 在主代理而非从代理中运行Jenkins后期构建步骤 - Running Jenkins post build step in master agent instead of slave agent Jenkins从属设置-主节点和从属节点都是Linux机器 - Jenkins slave set-up - both master and slave nodes are Linux machines
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM