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.

How can I trigger 'auto promote' multiple times? #4691

xema027 ·

From 'Conf A' --> 'Conf B', I want to promote 'Conf B' to X times (X can be variable) based on the results of 'Conf A'.
For example, let's say there is a program that needs to be built separately for each country.
: If QA (Conf A) is successful -> Automatically release build (Conf B) for the successful countries.

The problem is that A can be one, but B can be multiple, and manual promotion should also be possible in the future.
I confirmed that it is possible to promote multiple times manually, but it seems to only work once automatically, so I am asking.

Is there a way to do this?

  • replies 3
  • views 32
  • stars 0
robinshen ADMIN ·

I guess multiple triggering of Conf B should have different variables in order to make them different? But with a single auto promotion definition, it is impossible to use different variables for different runs.

xema027 ·

Instead of using auto promotion, but I want to configure and operate the step like this using a groovy script.
Are there any parts that might be problematic?

def promotion = configuration.getPromotion("test")
...
def docs = response.documents
docs.each { doc ->
def variables = ['country': doc.country]
promotion.promote(build, variables)
}

robinshen ADMIN ·

Better to use below version:

import com.pmease.quickbuild.ScriptEngine

// use find to get promotion in ancestor configurations if not found in current configuration
def promotion = configuration.findPromotion("test")

// in case we embed scripts in promotion definitions
promotion = ScriptEngine.instance.installInterpolator(promotion)

...
def docs = response.documents
docs.each { doc ->
def variables = ['country': doc.country]
promotion.promote(build, variables)
}