diff options
author | Philip Hands <phil@hands.com> | 2016-07-18 16:28:03 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-07-18 19:59:17 +0200 |
commit | af7115a39adaff5c397c9a1adebb7752487d1814 (patch) | |
tree | e796d06a00b5c9b67e34ede9b59a007f42bf6a59 | |
parent | f7e88d07551f9c1c71ca72d8653e68cde1dbe883 (diff) | |
download | jenkins.debian.net-af7115a39adaff5c397c9a1adebb7752487d1814.tar.xz |
d-i: factor out common parts of the defaults
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | job-cfg/d-i.yaml.py | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/job-cfg/d-i.yaml.py b/job-cfg/d-i.yaml.py index b9065474..f1b477c2 100755 --- a/job-cfg/d-i.yaml.py +++ b/job-cfg/d-i.yaml.py @@ -328,7 +328,28 @@ def jobspec_svn(key, name, desc, defaults=None, j['logrotate'] = lr(logkeep) return {key: j} - +def gen_default(name, downstream=None, envfile=None, parameters=None): + builders = [{'shell': '/srv/jenkins/bin/d-i_build.sh'}] + if envfile is not None: + builders.append({'inject': {'properties-file': envfile}}) + if downstream is not None: + builders.append({'trigger-builds': downstream}) + + ret = {'defaults': { + 'name': name, + 'description': ('Builds Debian packages in sid from git {branchdesc}, ' + 'triggered by pushes to <pre>{gitrepo}</pre> ' + '{do_not_edit}'), + 'triggers': [{'pollscm': {'cron': '{trg}'}}], + 'scm': [{'git': {'url': '{gitrepo}', + 'branches': ['{branch}']}}], + 'builders': builders, + 'project-type': 'freestyle', + 'properties': prop(type='packages', priority=99), + 'parameters': parameters, + 'logrotate': lr(90), + 'publishers': publ(irc='debian-boot')}} + return ret # -- here we build the data to be dumped as yaml data = [] @@ -358,46 +379,16 @@ for f in ['html', 'pdf']: logkeep=90)) templs.append(jtmpl(act='manual', target='{lang}', fmt=f, po=po)) -data.extend( - [{'defaults': { - 'name': '{name}-{act}', - 'description': ('Builds Debian packages in sid from git {branchdesc}, ' - 'triggered by pushes to <pre>{gitrepo}</pre> ' - '{do_not_edit}'), - 'triggers': [{'pollscm': {'cron': '{trg}'}}], - 'scm': [{'git': {'url': '{gitrepo}', - 'branches': ['{branch}']}}], - 'builders': [{'shell': '/srv/jenkins/bin/d-i_build.sh'}, - {'trigger-builds': [{'project': 'lvc_debian-miniiso', - 'current-parameters': 'true', - }]}], - 'project-type': 'freestyle', - 'properties': prop(type='packages', priority=99), - 'parameters': [{'string': {'name': 'TRIGGERING_BRANCH', - 'description': 'git branch that triggered the build that resulted in this subsequent build.'}}], - 'logrotate': lr(90), - 'publishers': publ(irc='debian-boot')}}]) - -data.extend( - [{'defaults': { - 'name': '{name}-pu-{act}', - 'description': ('Builds Debian packages in sid from git {branchdesc}, ' - 'triggered by pushes to <pre>{gitrepo}</pre> ' - '{do_not_edit}'), - 'triggers': [{'pollscm': {'cron': '{trg}'}}], - 'scm': [{'git': {'url': '{gitrepo}', - 'branches': ['{branch}']}}], - 'builders': [ {'shell': '/srv/jenkins/bin/d-i_build.sh'}, - {'inject': {'properties-file': 'env.txt'}}, - {'trigger-builds': [{'project': 'd-i_pu-triggered_debian-installer', - 'predefined-parameters': 'TRIGGERING_BRANCH=$OUR_BRANCH' - }, - ]} - ], - 'project-type': 'freestyle', - 'properties': prop(type='packages', priority=99), - 'logrotate': lr(90), - 'publishers': publ(irc='debian-boot')}}]) +data.append(gen_default( + name='{name}-{act}', + downstream=[{'project': 'lvc_debian-miniiso', 'current-parameters': 'true'}], + parameters=[ {'string': {'name': 'TRIGGERING_BRANCH', 'description': 'git branch that triggered the build that resulted in this subsequent build.'}}], + )) +data.append(gen_default( + name='{name}-pu-{act}', + downstream=[{'project': 'd-i_pu-triggered_debian-installer','predefined-parameters': 'TRIGGERING_BRANCH=$OUR_BRANCH'}], + envfile='env.txt', + )) templs.append(jtmpl(act='{act}', target='{pkg}')) templs.append(jtmpl(act='pu-{act}', target='{pkg}')) |