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.

QB3.1 Trigger other build steps #1554

mvuser ·
Hi Robin,
On Jan 18, 2011 I had a question with the same subject, now we want to elaborate that further.
We have a product configuration, which triggers builds in other configurations and then
executes its own build step. The steps are arranged as shown below

master
Checkout
Trigger Other Configurations (sequential step to hide the repeat step
until checkout step happened)
_Trigger Other Configurations InnerStep (repeat step to trigger other builds in
configurations read form a file)
_Trigger Other Build InnerStep (Trigger Other Builds Step which triggers the builds
set in the repeat parameter )

Build (Build step for this configuration)

Java Reports
...

Subversion Tagging

Up to now the triggered builds are executed without respecting the Build Condition set
in that configuration (If changes found in referenced repository or last build failed).
Now we want them to respect the build condition or do the build if one of the builds which
was triggered prior to that in the repeat loop was really built.
At last the build step in the product configuration itself only shall be executed if at
least one of the triggered builds was executed.

So I think
- I need to get the information if a triggered build was really executed
- must achive that the triggered builds respect the build condition if no build was executed prior in the loop

How can I achieve that?

best regards
Friedhelm
  • replies 3
  • views 1460
  • stars 0
robinshen ADMIN ·
Hi Friedhelm,

This can not be achieved with the "trigger other build" step, as this step is designed to run the build immediately. The QuickBuild repository serves your purpose:
http://wiki.pmease.com/display/QB31/Set ... Dependency
However QuickBuild repository can not use repeat params. In QB4, we will re-working the build dependency mechanism to make it possible.

Regards
Robin
mvuser ·
Hi Robin,

I think it would be really fine to have the possibility to tell the build which will be
triggered in the repeate step to respect the build condition, a feature that exists
in the rest BuildRequest (<respectBuildCondition>).
As I see I can set variables to be used in the triggered build. Is there a chance to
use such a variable to control the respectBuildCondition?

Regards
Friedhelm
robinshen ADMIN ·
Hi Friedhelm,

Yes this can be achieved. Assume A will trigger B via "trigger other build" step, please define pre-queue script of B to execute below script:
if (!request.scheduled && vars.get("respectBuildCondition") != null)
request.setRespectBuildCondition(vars.get("respectBuildCondition").asBoolean());

Then in the step to trigger B, you may pass variable "respectBuildCondition" to control whether or not B should respect the build condition.

The build condition for A can be set to:
groovy:
def dependentId = system.configurationManager.get("root/path/to/B").latestBuild.id;
if (dependentId > configuration.latestBuild.id) // if triggered configuration generated a new build
return true;
for (each in configuration.referencedRepositories) {
if (each.changed)
return true;
}
return false;


With refactored dependency mechanism in QB4, above logic will not be necessary to handle build dependencies between different configurations.

Regards
Robin