Using Jenkins for running a Re-image on slave nodes.

11 views
Skip to first unread message

hearm...@gmail.com

unread,
Feb 12, 2017, 10:55:02 PM2/12/17
to Jenkins Users
Hello.

I'm a relatively new Jenkins user. My use-case for Jenkins is extremely specific:

1>I must re-image a slave node which is connected to the Master via Java Web Start.
2>The computer on re-imaging should execute the batch file in its startup folder which connects it back to the Master.
3>The slave node must then execute the remaining instructions on the job.

What I want to know is how to make a Jenkins job which can actually do this.
I have setup the batch files to do 1 & 2 and when I execute it as a job, it works fine.
The problem I am facing is that when the slave node is being re-imaged, it loses connection to the master and hence any instructions afterwards in the job will not be executed.
Is there any way I can lock that machine on to a set of tasks or jobs which it should execute on reconnection?
An ideal scenario would be one where I just have to schedule the task and it does (1), (2) and (3).
So I want the job to work as follows:
Job.start()
{
    Execute( "Restore-Image" )
    Wait.For.ConnectionFromSlave() <------------ How do I define a job which will wait for the slave node to finish re-imaging, then connect back and execute any instructions post this step?
    Execute Remaining actions
}

I have tried the BuildFlow plugin, but there's a lack of documentation on its usage and I haven't found helpful threads on StackOverflow either.
Help would be much appreciated.
Thank you.
Reply all
Reply to author
Forward
0 new messages