Wednesday, September 28, 2022

[FIXED] How to copy build XMLs from Master to the Slave node in Jenkins?

Issue

I have created a Jenkins job which used to run in the master and I have the build.xml file in the master.

Now I have added a slave node and added the setting Restrict where this project can be run so that my job always runs on a particular slave.

Now my build jobs are failing and I can see:

[EnvInject] - Loading node environment variables.
Building remotely on demo_slave_inst2 (slave1) in workspace /root/slave/workspace/demo_job
FATAL: Unable to find build script at /root/slave/workspace/demo_job/autobvt.xml
Build step 'Invoke Ant' marked build as failure
Recording test results
Finished: FAILURE

This autobvt.xml file already exists in the master. So looks like I need to copy this file over to the slave node manually which does not looks like quite handy.

How I can instruct jenkins to copy this as part of the build?


Solution

I sorted the issue using the Copy to Slave plugin.



Answered By - Exploring
Answer Checked By - Willingham (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.