I am trying to run different stages on different nodes in my jenkins pipeline like stage 1 is checkout, stage 2 is build, stage 3 unit testing. For example :
node ('linux1')
{
stage ('checkout')
..........
}
node ('linux2')
{
stage ('build')
........
}
node ('linux3')
{
stage ('unit testing')
...........
}
If I try to do this, my question is if I checkout code in Linux1 node, how come the other stages can run in different node while the checked out code is in node1.
How the code will be distributed and if my understanding is not correct, how can I achieve parallelism and ensure each stage can parallel and reduce time.
If possible, Please suggest any groovy pipeline documentation for writing Jenkins pipelines.