History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-4028
Type: Task Task
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robin Shen
Reporter: Phong Trinh
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Trigger configuration question

Created: 25/Sep/23 01:17 AM   Updated: 03/Oct/23 10:20 PM
Component/s: None
Affects Version/s: 12.0.19
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
 I have a quickbuild configuration to accept the following inputs for example:
  ProductName
  InstallVersion
  UpgradeVersion

 I would like to create a configuration/step/schedule to trigger this configuration to run following executions at the same time.
  Excution 1:
   ProductName=ProductA
   InstallVersion=1.0.0
   UpgradeVersion=1.0.1

  Excution 2:
   ProductName=ProductB
   InstallVersion=2.1.0
   UpgradeVersion=3.0.0

 Any suggestion is appreciated.

 ptrinh
 
  

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [25/Sep/23 01:27 AM]
You may create a separate configuration with two parallel steps triggering your parameterized configuration, and pass variables as required.

Phong Trinh [25/Sep/23 05:19 PM]
 Thank you very much for the suggestion. There may be 10 or more executions depend on each test. I think I may not want to create 10 steps in the configuration. Is it possible to scripting the trigger the test to run the number of executions based on user's input?

 Thanks,
Phong

Robin Shen [25/Sep/23 11:34 PM]
You may create a groovy script, and in the script parse user input, and call QB api to trigger build via system.buildEngine.requestBuild. You may check how to use the requestBuild in class "TriggerBuildStep"

Phong Trinh [25/Sep/23 11:47 PM]
May you give me examples of?

Robin Shen [26/Sep/23 01:33 AM]
Some example code:

import com.pmease.quickbuild.*;

def configurationIdToTrigger = system.configurationManager.get("path/to/trigger_configuration").id;

// parse your input variables and then loop below logic. For each loop, change newRequest.variables as necessary:

def newRequest = new BuildRequest();
newRequest.configurationId = configurationIdToTrigger;
newRequest.variables = ["var1":"vaule1", "var2":"value2"];
system.buildEngine.requestBuild(Context.getUser(), false, newRequest);

Robin Shen [26/Sep/23 01:33 AM]
Make sure to run this script for QB server.

Phong Trinh [26/Sep/23 02:02 PM]
Thank you very much, Robin! I am going to give it a try and will keep you informed.

Phong Trinh [03/Oct/23 06:19 PM]
It works great for my case. Thank you very much, Robin!

Robin Shen [03/Oct/23 10:20 PM]
You are welcome!