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.

get specific build object by build id? from referenced QB repo? #3974

OnQuickBuild ·

Hello Robin

Could you tell me if Groovy API could get a build object by buildId?

I have a configuration that checks out a QB repo artifacts. And I'm also trying to get that build object to access its variable values as well.
So far I can only get to this point:
if I use referenced repo object (QuickbuildRepository class), it gives me the buildId of that checkout dependency (by using function repo.getRevision().getValue())
And I know which configuration this build object belongs to, but I couldn't find a function from configuration object that returns build by Id (no .getBuild(Long Id) something like this)

Or, if the QB repo object (QuickbuildRepository) itself can just return the dependency object directly, that'd be even better.

Thanks very much!

  • solved #3
  • replies 2
  • views 2896
  • stars 0
OnQuickBuild ·

I know it returns all the builds by getBuilds(), then I can compare the buildId with each one. Is there a easier way?

Thanks

robinshen ADMIN ·

with any build id, you can get the build object by running:
def build = system.buildManager.load(buildId);
And build.getVariableValues() will return all variables stored in the build as a map