summaryrefslogtreecommitdiffstats
path: root/job-cfg/rebootstrap.yaml.py
blob: a946494f9792cc9e9ac41a17df9caf96afe1644f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/python

architectures = """
   kfreebsd-amd64
   i386 kfreebsd-i386
   mips mips64el mipsel
   powerpc ppc64
   s390x
   sparc sparc64
   x32
   """.split()

mono_architectures = """
    armel armhf kfreebsd-armhf arm64 arm64ilp32 hurd-amd64
    musl-linux-armhf musl-linux-arm64
    alpha
    hppa
    hurd-i386 musl-linux-i386
    m68k
    mips64r6el mipsr6el
    musl-linux-mips musl-linux-mipsel
    nios2
    powerpcel powerpcspe ppc64el
    sh4
    tilegx
    """.split()

release_architectures = """
    armel armhf arm64
    i386
    mips mips64el mipsel
    powerpc ppc64el
    s390x
    """.split()

architectures += mono_architectures

gcc_versions = ("6",)
diffoscope_gcc_versions = ("6",)

print("""
- defaults:
    name: rebootstrap
    project-type: freestyle
    properties:
      - sidebar:
          url: https://jenkins.debian.net/userContent/about.html
          text: About jenkins.debian.net
          icon: /userContent/images/debian-swirl-24x24.png
      - sidebar:
          url: https://jenkins.debian.net/view/rebootstrap/
          text: All rebootstrap jobs
          icon: /userContent/images/debian-jenkins-24x24.png
      - sidebar:
          url: http://www.profitbricks.co.uk
          text: Sponsored by Profitbricks
          icon: /userContent/images/profitbricks-24x24.png
      - priority-sorter:
          priority: '150'
      - throttle:
          max-total: 5
          max-per-node: 5
          enabled: true
          option: category
          categories:
            - rebootstrap
    description: '{my_description}{do_not_edit}'
    logrotate:
      daysToKeep: 90
      numToKeep: 10
      artifactDaysToKeep: -1
      artifactNumToKeep: -1
    scm:
      - git:
          url: 'git://anonscm.debian.org/users/helmutg/rebootstrap.git'
          branches:
            - '{my_branchname}'
    builders:
      - shell: '{my_wrapper} {my_branchname} HOST_ARCH={my_arch} {my_params}'
    publishers:
      - logparser:
          parse-rules: '/srv/jenkins/logparse/rebootstrap.rules'
          unstable-on-warning: 'false'
          fail-on-error: 'false'
      - email:
          recipients: 'jenkins+debian-bootstrap helmutg@debian.org'
    triggers:
      - pollscm:
          cron: '*/6 * * * *'
    node: '{my_node}'
""")

for arch in sorted(architectures):
    for gccver in sorted(gcc_versions):
        for nobiarch in ["", "_nobiarch"]:
            if nobiarch and arch in mono_architectures:
                continue
            for supported in ["", "_supported"]:
                if (nobiarch or arch.startswith("musl-linux-") or arch.startswith("hurd-") or arch.startswith("kfreebsd-")) and supported:
                    continue
                for diffoscope in ["", "_diffoscope"]:
                    if diffoscope and (arch not in release_architectures or gccver not in diffoscope_gcc_versions):
                        continue
                    print("""
- job-template:
    defaults: rebootstrap
    name: '{name}_%(arch)s_gcc%(gccshortver)s%(nobiarch)s%(supported)s%(diffoscope)s'""" %
    dict(arch=arch, gccshortver=gccver.replace(".", ""), nobiarch=nobiarch, supported=supported, diffoscope=diffoscope))

print("""
- project:
    name: rebootstrap
    do_not_edit: '<br><br>Job configuration source is <a href="https://anonscm.debian.org/git/qa/jenkins.debian.net.git/tree/job-cfg/rebootstrap.yaml.py">rebootstrap.yaml.py</a>.'
    jobs:""")
for arch in sorted(architectures):
    for gccver in sorted(gcc_versions):
        for nobiarch in (False, True):
            if nobiarch and arch in mono_architectures:
                continue
            for supported in (False, True):
                if (nobiarch or arch.startswith("musl-linux-") or arch.startswith("hurd-") or arch.startswith("kfreebsd-")) and supported:
                    continue
                for diffoscope in (False, True):
                    if diffoscope and (arch not in release_architectures or gccver not in diffoscope_gcc_versions):
                        continue
                    print(
"""        - '{name}_%(suffix)s':
            my_arch: '%(arch)s'
            my_params: 'GCC_VER=%(gccver)s ENABLE_MULTILIB=%(multilib_value)s ENABLE_MULTIARCH_GCC=%(multiarch_gcc_value)s ENABLE_DIFFOSCOPE=%(diffoscope_value)s'
            my_description: 'Verify bootstrappability of Debian using gcc-%(gccver)s%(nobiarch_comment)s for %(arch)s%(supported_comment)s%(diffoscope_comment)s'
            my_branchname: 'jenkins_%(suffix)s'
            my_node: '%(node)s'
            my_wrapper: '/srv/jenkins/bin/jenkins_master_wrapper.sh'""" %
                dict(arch=arch,
                     suffix=arch + "_gcc" + gccver.replace(".", "") + ("_nobiarch" if nobiarch else "") + ("_supported" if supported else "") + ("_diffoscope" if diffoscope else ""),
                     gccver=gccver,
                     multilib_value="no" if nobiarch else "yes",
                     nobiarch_comment=" without multilib" if nobiarch else "",
                     multiarch_gcc_value="no" if supported else "yes",
                     supported_comment=" using the supported method" if supported else "",
                     diffoscope_value="yes" if diffoscope else "no",
                     diffoscope_comment=" showing diffoscopes" if diffoscope else "",
                     node="profitbricks9"))