Checkout code using jenkins pipeline in jenkins at a particular and perform build any available nodes/agents

64 views
Skip to first unread message

gaurav pant

unread,
Aug 7, 2018, 7:52:27 AM8/7/18
to Jenkins Users

 am trying to checkout the code at a particular location (ex. C:\scm\) on windows using jenkins pipeline (jenkinsfile) and want to execute the build from the checkout location (C:\scm\) in any available nodes/agents at that particular time.

Can you please provide any leads? (Was able to do on linux machine)

Something like below:-

node ('win1')

{

stage ('checkout')

..........

}


node ('win2')

{

stage ('build')

........

}

My requirement is I should checkout my code at particular location (master jenkins) whenever my job is triggered and able to build it on any available node at that particular time rather than building it on the master jenkins only (require this to not overload the jenkins master)

Baptiste Mathus

unread,
Aug 14, 2018, 11:56:36 AM8/14/18
to jenkins...@googlegroups.com
Something seems wrong with your requirements: IIUC you want to checkout the sources on the master, and build elsewhere. Is this really what you mean?

If so, then maybe you should start by thinking how you would do this outside of Jenkins context, then get back to doing it with Jenkins. That should hopefully help you better figure what you need.

To somehow spoil the outcome, to me something seems fishy. The only 'solution' for me for what you're asking for would result in some kind of FrankensteinBuild :). (Like using shared FS between nodes etc. Note: do not do that).

Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0a967f20-e16f-4cb1-a627-b42053eda381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages