<< Back to previous view

[QB-4028] Trigger configuration question
Created: 25/Sep/23  Updated: 03/Oct/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   
 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
 
  

 Comments   
Comment by 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.
Comment by 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
Comment by 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"
Comment by Phong Trinh [ 25/Sep/23 11:47 PM ]
May you give me examples of?
Comment by 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);
Comment by Robin Shen [ 26/Sep/23 01:33 AM ]
Make sure to run this script for QB server.
Comment by 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.
Comment by Phong Trinh [ 03/Oct/23 06:19 PM ]
It works great for my case. Thank you very much, Robin!
Comment by Robin Shen [ 03/Oct/23 10:20 PM ]
You are welcome!
Generated at Thu May 16 22:15:03 UTC 2024 using JIRA 189.