Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Run promotion via groovy script #3662

robinshen ADMIN ·

Normally you run a promotion by hitting the promotion button, but sometimes a script to run it programmatically will be handy, for instance when you want to run the promotion as a step as part of other process:

import com.pmease.quickbuild.ScriptEngine;
def srcConf = system.getConfiguration("path/to/src/configuration");
def buildToPromote = srcConf.latestSuccessfulBuild;
def promotion = srcConf.findPromotion("your promotion name");
promotion = ScriptEngine.instance.installInterpolator(promotion);
def vars = ["name1": "value1", "name2": "value2"];
promotion.promote(buildToPromote, vars);
  • replies 2
  • views 2224
  • stars 0
julianb ·

for future reference
the fifth line should read:

promotion = ScriptEngine.instance.installInterpolator(promotion);

best regards,
Julian

robinshen ADMIN ·
Yes, you are right. Got it fixed now.