var name: <name of the variable>
var value: ${build.getVarValue("<name of the variable>")}
is this (variables from promotion source build are NOT copied automatically to promotion destination build) still the case?
Somehow it looks like in our experiment (using QB version 5.0.22) all variables (maybe that are used in the promotion source build?) are automatically also copied to the promotion destination build.
Thanks,
Reinhold
1. variables defined in promotion setting.
2. variables defined in target configuration hierarchy.
3. variables used in source build.
Would you mind updating this in the documentation, or did I just overlook it there?
Thanks, Reinhold
sorry for my late response, but while I still was a little bit confused (why => see below), I was on the other hand a little bit happy/lucky, because this (automatically looking for variables in source build) also helped me; although the documentation at http://wiki.pmease.com/display/QB51/Set ... +Promotion in section "Control promotion process with variables" IMHO still says something different (i.e. no auto-availability/promotion of variables).
Anyway.
Now that I continued with our build pipeline this aforementioned confusion re-happened:
[list]
In our case we have some rather generic steps that are configured by means of variables (to avoid/reduce duplications and thus a maintenance nightmare) and these step configuration variables are also automatically available/promoted in any (!?) subsequent stage.[/*:m]
one general checkbox (enabled by default for old backwards compatible behaviour) for "auto-availability/promotion of all variables of source build in destination build"[/*:m]
[*] and in the variables section -- for the sake of convenience -- a dedicated checkbox per variable that allows to keep all fields except name empty (i.e. prompt, value, description) that says "auto-availability/promotion of this variable of source build in destination build"[/*:m][/list:u][/*:m][/list:u][/*:m][/list:u]
What do you think of this approach?
Thanks,
Reinhold
P.S.: Now (a few minutes after this post) I found "Use value stored in source build during promotion" -- this would replace the dedicated convenience checkbox in item #2 of the aforementioned approach. But of course I still think this is automatically the case for all variables (not defined in the promotion variables section), which can be very dangerous...
[quote="robinshen"]Yes that is true. In QB5, when access a certain variable, it searches in below order:
1. variables defined in promotion setting.
2. variables defined in target configuration hierarchy.
3. variables used in source build.[/quote]
Does it matter if my script call vars.get("") or build.getVar("") in destination build?
Do they always contain the same set of variable values (e.g. vars.getAll() <=> build.getVariables())?