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 file from triggered configurations #4163

nini10 ·

Hi,

Is it possible to get file from triggered configuration build?

For example: in Configuration A, there is a "trigger other configuration" step that trigger Configuration B. When the build in Conf B. done, the build in Conf A. need to get one file that created by Conf B build.

If it possible - could you please provide example code?

Thanks

  • replies 7
  • views 419
  • stars 1
robinshen ADMIN ·
uartie ·

I have a similar situation. However, I need to send variables to the triggered build. Then retrieve the artifacts from that triggered build. Also, I want the triggered build to run unconditionally (i.e. don't respect build condition of triggered build). Can this be done?

uartie ·

I have a similar situation. However, I need to send variables to the triggered build. Then retrieve the artifacts from that triggered build. Also, I want the triggered build to run unconditionally (i.e. don't respect build condition of triggered build). Can this be done?

With a little bit of extrapolation of https://support.pmease.com/PMEase/QuickBuild/topics/3009/fetch-artefacts-from-a-triggered-build-qb-5-1-33-/5 and https://support.pmease.com/PMEase/QuickBuild/topics/4156/get-variable-from-triggered-build/2 it seems to provide a workaround. Would be nicer, though, if there was built-in feature to do this with "trigger other builds" step.

robinshen ADMIN ·

A better approach is to retrieve artifacts directly via groovy script after triggered build is finished:

groovy:
def triggeredBuildId = steps.get("theTriggeringStep").runtime.customData
def publishDirOfTriggeredBuild = grid.serverNode.nodeService.getBuildPublishDir(triggeredBuildId)
grid.transferFiles(grid.serverNode, publishDirOfTriggeredBuild, "artifacts/**", grid.localNode, configuration.workspaceDir.absolutePath, true, false, null, null);
uartie ·

Yes, that seems better... much less voodoo magic :wink: And if we put it in the "Post-Execute Action" of the "Trigger Other Builds" step, it could be simplified a little, too (e.g. steps.get("theTriggeringStep") becomes current :slight_smile:

uartie ·

...especially if "Repeat Parameters" are used.

robinshen ADMIN ·

Yes, that is a better place.