Skip to content
......@@ -2,13 +2,8 @@
# -*- coding: utf-8 -*-
import sys
import os
from string import join
from yaml import load, dump
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
import yaml
import string
base_distros = [
......@@ -99,6 +94,7 @@ all_targets = [
'design-desktop-web',
]
#
# not all packages are available in all distros
#
......@@ -121,11 +117,15 @@ def is_target_in_distro(distro, target):
# parl-desktop* and design-desktop* packages only exist since stretch
elif distro in ('jessie') and (target[:12] == 'parl-desktop' or target[:14] == 'design-desktop'):
return False
# parl-desktop* packages have been removed from stretch.
elif distro in ('stretch') and target[:12] == 'parl-desktop':
return False
# education-desktop-lxqt, education-primaryschool and education-video packages only exist since buster
elif distro in ('jessie', 'stretch') and target in ('education-desktop-lxqt', 'education-primaryschool', 'education-video'):
return False
return True
#
# who gets mail for which target
#
......@@ -145,6 +145,7 @@ def get_recipients(target):
else:
return 'jenkins+debian-qa qa-jenkins-scm@lists.alioth.debian.org'
#
# views for different targets
#
......@@ -159,6 +160,7 @@ def get_view(target, distro):
else:
return 'chroot-installation'
#
# special descriptions used for some targets
#
......@@ -178,6 +180,7 @@ spoken_names = {
'debconf-video': 'all packages relevant for the DebConf videoteam',
}
def get_spoken_name(target):
if target[:12] == 'parl-desktop':
return 'the Debian Parl metapackage '+target
......@@ -190,6 +193,7 @@ def get_spoken_name(target):
else:
return target
#
# nothing to edit below
#
......@@ -198,14 +202,16 @@ def get_spoken_name(target):
# This structure contains the differences between the default, upgrade and upgrade_apt+dpkg_first jobs
#
jobspecs = [
{ 'j_ext': '',
{
'j_ext': '',
'd_ext': '',
's_ext': '',
'dist_func': (lambda d: d),
'distfilter': (lambda d: tuple(set(d))),
'skiptaryet': (lambda t: False)
},
{ 'j_ext': '_upgrade_to_{dist2}',
{
'j_ext': '_upgrade_to_{dist2}',
'd_ext': ', then upgrade to {dist2}',
's_ext': ' {dist2}',
'dist_func': (lambda d: [{dist: {'dist2': distro_upgrades[dist]}} for dist in d]),
......@@ -214,6 +220,7 @@ jobspecs = [
},
]
# some functions first…
#
......@@ -222,6 +229,7 @@ jobspecs = [
def get_targets_in_distro(distro):
return [t for t in all_targets if is_target_in_distro(distro, t)]
#
# given a target, returns a list of ([dist], key) tuples, so we can handle the
# edu packages having views that are distro dependent
......@@ -261,8 +269,7 @@ data.append(
{'sidebar': {'icon': '/userContent/images/profitbricks-24x24.png',
'text': 'Sponsored by Profitbricks',
'url': 'http://www.profitbricks.co.uk'}},
{ 'priority-sorter': { 'priority': '{my_prio}'}},
],
{'priority-sorter': {'priority': '{my_prio}'}}],
'publishers': [{'trigger': {'project': '{my_trigger}'}},
{'email-ext': {'attach-build-log': False,
'body': 'See $BUILD_URL/console or just $BUILD_URL for more information.',
......@@ -273,7 +280,7 @@ data.append(
'recipients': '{my_recipients}',
'subject': '$BUILD_STATUS: $JOB_NAME/$BUILD_NUMBER'}},
{'logparser': {'parse-rules': '/srv/jenkins/logparse/chroot-installation.rules',
'unstable-on-warning': True,}},
'unstable-on-warning': True}},
{'naginator': {'progressive-delay-increment': 5,
'progressive-delay-maximum': 15,
'max-failed-builds': 3,
......@@ -336,7 +343,7 @@ for jobindex, jobspec in enumerate(jobspecs):
'action': 'bootstrap',
'dist': list(dists) if jobspec['j_ext'] == '' else
[{dist: {'dist2': distro_upgrades[dist]}} for dist in dists],
'my_trigger': join(['chroot-installation_{dist}_install_'+t+jobspec['j_ext']
'my_trigger': string.join(['chroot-installation_{dist}_install_'+t+jobspec['j_ext']
for t in list(trigs)], ', '),
'my_description': 'Debootstrap {dist}'+jobspec['d_ext']+'.',
'my_prio': 131,
......@@ -383,4 +390,4 @@ data.append({'project': {
'my_time': '',
'jobs': jobs}})
sys.stdout.write(dump(data, Dumper=Dumper))
sys.stdout.write(yaml.dump(data))