Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out in which Slave the Jenkins Pipeline is running

I am starting my Pipeline this way:

node('my_Label') { // my code }

I want to know in which Slave my code is running. I tried multiple things but I was not able to find out the correct method to call for that :(

Thank you in advance

like image 208
Leon Avatar asked Nov 11 '16 16:11

Leon


1 Answers

The environment variable ${NODE_NAME} should have it:

node ('my_Label) {
   println "${NODE_NAME}"
}
like image 189
Peter McNab Avatar answered Sep 18 '22 11:09

Peter McNab