summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-09-09 13:47:05 (GMT)
committerDaniel Stone <daniels@collabora.com>2016-09-09 13:47:05 (GMT)
commitd1c2d5010c042b325927fde042e19972ba350d68 (patch)
tree924cd78cce1e3bc8df8eda5e9a3b3a0bd90d128d
parent23cbeda2e9fba565702bb8af5374cf37bf230c33 (diff)
downloadjenkins-job-builder-d1c2d5010c042b325927fde042e19972ba350d68.tar.gz
jenkins-job-builder-d1c2d5010c042b325927fde042e19972ba350d68.tar.xz
parser: Apply defaults to projectsHEADmaster
Also apply defaults to projects, allowing axis parameter expansion to occur on projects as well. Previously, as default application did not happen, attempting to use an axis defined through defaults for project template substitution would result in a large explosion. Example: - job-template: name: 'foo/bar/{platform}-{arch}' - project: name: 'foo/bar' jobs: - foo/bar/{platform}-{arch} - defaults: platform: - debian-jessie - centos-7 arch: - x86-64 - armv7
-rw-r--r--jenkins_jobs/parser.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/jenkins_jobs/parser.py b/jenkins_jobs/parser.py
index f39d08e..811dbe8 100644
--- a/jenkins_jobs/parser.py
+++ b/jenkins_jobs/parser.py
@@ -236,6 +236,7 @@ class YamlParser(object):
self.jobs.append(job)
for project in self.data.get('project', {}).values():
logger.debug("Expanding project '{0}'".format(project['name']))
+ project = self._applyDefaults(project)
# use a set to check for duplicate job references in projects
seen = set()
for jobspec in project.get('jobs', []):