<< Back to previous view

[QB-2155] Create a 'Trigger Promotion' step
Created: 19/Aug/14  Updated: 19/Aug/14

Status: Open
Project: QuickBuild
Component/s: None
Affects Version/s: 5.1.32
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Beirti Assigned To: Robin Shen
Resolution: Unresolved Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown


 Description   
Currently, you can trigger another build, but not a promotion without some custom groovy and restrictions outlined below:

UI should allow specifying:
- Source configuration
- Whether to use last successful, last build, or build id calculated by script
- Promotion to trigger
- Variables to pass to promotion step

Node selection must be 'server'.

Script:
groovy:
import com.pmease.quickbuild.*
import com.pmease.quickbuild.persistence.*

def confName = 'PATH_TO_BUILD_CONFIGURATION_TO_PROMOTE';
def conf = system.getConfiguration(confName);
logger.info ('Configuration: ' + conf);
def latestSuccessful = conf.getLatestSuccessfulBuild();
logger.info ('Latest Successful Build: ' + latestSuccessful );

def promotionDef = conf.findPromotion('NAME_OF_PROMOTION');
promotionDef = ScriptEngine.instance.installInterpolator(promotionDef);
logger.info ('Promotion: ' + promotionDef);

def variables = [environment:vars.getValue('environment')] // Populate required variables here

Context.push(latestSuccessful)
try {
  promotionDef.promote(latestSuccessful, variables );
} finally {
  Context.pop()
}
Generated at Tue May 21 17:48:47 UTC 2024 using JIRA 189.