<< Back to previous view

[QB-4032] Wait for trigger to be done.
Created: 10/Oct/23  Updated: 23/Dec/23

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 12.0.19
Fix Version/s: None

Type: Task Priority: Major
Reporter: Phong Trinh Assigned To: Robin Shen
Resolution: Won't Fix Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown


 Description   
 Hi Robin/Support Team,
 I created a QB step to run the following groovy script to trigger a configuration:
================================================================================
import com.pmease.quickbuild.*;
def configurationIdToTrigger = system.configurationManager.get("path/to/trigger_configuration").id;
def vars = '1.0,1.1,1.2'
def newRequest = new BuildRequest();
newRequest.configurationId = configurationIdToTrigger;
def arrayVars = vars.split(',');
def var1
for(int nLoop = 0; nLoop < arrayVars.length; nLoop++) {
 var1 = arrayVar[nLoop]
 newRequest.variables = ["var1":var1, "var2":"value2"];
 system.buildEngine.requestBuild(Context.getUser(), false, newRequest);
}
============================================================================
 Is there any way that this step can wait for the configuration to finish which is similar to 'Wait For Finishing' when creating 'Trigger Other Builds'?

 Thanks,
ptrinh

 Comments   
Comment by Robin Shen [ 10/Oct/23 11:26 PM ]
Please check QB source TriggerBuildStep.java. It checks build status periodically to wait for its completion. You may transtate that logic into groovy in your script.
Comment by Phong Trinh [ 11/Oct/23 06:50 PM ]
Thanks, Robin!
Generated at Thu Oct 31 23:20:52 UTC 2024 using JIRA 189.