How to get current node name job in jenkins using groovy

I have a sample job on a node "Windows-prod" node. How to get node name using groovy script?

+1
source share
1 answer

Your question is vague. There are two ways to run groovy scripts. groovy on the console that launches groovy (.... / script)

Below is a list of node to set using groovy console

def item = hudson.model.Hudson.instance.getItem("createAndPublishSnapshot") def build = item.getLastBuild() println build.isInProgress() println build.getBuiltOn().getNodeName() 
+1
source

Source: https://habr.com/ru/post/1011822/


All Articles