Set default value for gerrit trigger server name
In cases when jenkins has more than 1 gerrit server
configured in gerrit trigger plugin settings, it is needed
to set gerrit trigger server name inside job explicitly,
because default '__ANY__' setting will have unpredictable
consequences.
This commit preserves default value for gerrit trigger server
equal to '__ANY__', in the same time it allows
to override this value in pillar. In _common.xml gerrit trigger
server name will be searched firstly in job definition, in case
when not found, value from client pillar will be taken.
Change-Id: Ib7c94cfcec8e5b5775f43948870486e17432b7b6
diff --git a/jenkins/files/jobs/_common.xml b/jenkins/files/jobs/_common.xml
index e62d08b..47dcc87 100644
--- a/jenkins/files/jobs/_common.xml
+++ b/jenkins/files/jobs/_common.xml
@@ -126,7 +126,7 @@
{%- else %}
<customUrl/>
{%- endif %}
- <serverName>{{ trigger.server|default('__ANY__') }}</serverName>
+ <serverName>{{ trigger.get('server', client.get('trigger_gerrit_server', '__ANY__')) }}</serverName>
<triggerOnEvents>
{%- for ename, actions in trigger.event.iteritems() %}
{%- for action in actions %}