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.

Dynamically Generate And Use Resource #4328

tomz ·

I'm using script code to create a resource and assign a node to it, but when I try to trigger a build using that resource, it gives an error.

The following is the code block:

def addTempResource(String resName, String hostName)
  def resman = ResourceManager.instance;
  def tempResourceCriteria = new HostNameNodeSelection();
  def tempResourceProvider = new ResourceProvider();
  def resProviders = new ArrayList<ResourceProvider>();
  def finalResource = new Resource();

I can see the resource for the example I created when I use the web interface:

But I get the error on use:

Trigger Data Build for Presub Warming' is failed: Error allocating node for step 'master': Resource '************PresubWarmer' is not defined.

I've checked to ensure the actual resource name does case-sensitive match what the error message is saying. What am I missing?

  • replies 3
  • views 303
  • stars 0
robinshen ADMIN ·

Use, null) instead of The suggested method will take care of caching the resource so that build can find it.

robinshen ADMIN ·

Also make sure that this script runs on QB server.

tomz ·

It does run on the server, and this worked like a charm, thanks!