Key: |
QB-2155
|
Type: |
Improvement
|
Status: |
Open
|
Priority: |
Major
|
Assignee: |
Robin Shen
|
Reporter: |
Beirti
|
Votes: |
0
|
Watchers: |
0
|
If you were logged in you would be able to see more operations.
|
|
|
QuickBuild
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
|
|
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()
}
|
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()
} |
Show » |
There are no comments yet on this issue.
|
|