Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

[node selection] how to use "node with specified script evaluating to true"? #4038

OnQuickBuild ·

Hello Robin

I'm trying to use this node selection scheme for some steps. I have the user attributes defined for all the apposite nodes. But I don't know what the return value should be here, node address?

If I collected a few apposite nodes based on the correct user attributes, how should I "evaluate to true" for the nodes here? Is this like repeat parameters? Return a List object? But what should the List object contain? Node address, IP, or ID?

Thank you!

  • solved #2
  • replies 1
  • views 2220
  • stars 0
robinshen ADMIN ·

For each node, QB passes in the "node" object and evaluates this script and if the return value is true, the node is considered to be applicable for the step. For instance, if you want the step to run on any build agent with user attribute "dbVersion" set to "2", just write the script as below:

groovy:
node.getAttribute("dbVersion") == "2"