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

Key: QB-2155
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Robin Shen
Reporter: Beirti
Votes: 0
Watchers: 0
Operations

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

Create a 'Trigger Promotion' step

Created: 19/Aug/14 11:28 AM   Updated: 19/Aug/14 11:28 AM
Component/s: None
Affects Version/s: 5.1.32
Fix Version/s: None

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


 Description  « Hide
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()
}

 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.