forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schedulers_definition.py
160 lines (120 loc) · 3.89 KB
/
schedulers_definition.py
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
from buildbot.plugins import schedulers, util
from constants import (
builders_autobake,
builders_big,
builders_dockerlibrary,
builders_eco,
builders_install,
builders_upgrade,
builders_wordpress,
github_status_builders,
supportedPlatforms,
)
####### SCHEDULER HELPER FUNCTIONS
@util.renderer
def getBranchBuilderNames(props):
mBranch = props.getProperty("master_branch")
builders = list(
filter(lambda x: x not in github_status_builders, supportedPlatforms[mBranch])
)
return builders
@util.renderer
def getProtectedBuilderNames(props):
mBranch = props.getProperty("master_branch")
builders = list(
filter(lambda x: x in supportedPlatforms[mBranch], github_status_builders)
)
return builders
@util.renderer
def getAutobakeBuilderNames(props):
builderName = props.getProperty("parentbuildername")
for b in builders_autobake:
if builderName in b:
return [b]
return []
@util.renderer
def getBigtestBuilderNames(props):
builderName = str(props.getProperty("parentbuildername"))
for b in builders_big:
if builderName in b:
return [b]
return []
@util.renderer
def getInstallBuilderNames(props):
builderName = str(props.getProperty("parentbuildername"))
for b in builders_install:
if builderName in b:
builders = [b]
if "rhel" in builderName:
builders.append(b.replace("rhel", "almalinux"))
builders.append(b.replace("rhel", "rockylinux"))
return builders
return []
@util.renderer
def getUpgradeBuilderNames(props):
builderName = str(props.getProperty("parentbuildername"))
builds = []
for b in builders_upgrade:
if builderName in b:
if "rhel" in builderName:
builds.append(b.replace("rhel", "almalinux"))
builds.append(b.replace("rhel", "rockylinux"))
builds.append(b)
return builds
@util.renderer
def getEcoBuilderNames(props):
builderName = str(props.getProperty("parentbuildername"))
builds = []
for b in builders_eco:
if builderName in b:
builds.append(b)
return builds
@util.renderer
def getDockerLibraryNames(props):
return builders_dockerlibrary[0]
@util.renderer
def getWordpressNames(props):
return builders_wordpress[0]
def getSchedulers():
l = []
l.append(
schedulers.Triggerable(
name="s_upstream_all", builderNames=getBranchBuilderNames
)
)
schedulerProtectedBranches = schedulers.Triggerable(
name="s_protected_branches", builderNames=getProtectedBuilderNames
)
l.append(schedulerProtectedBranches)
schedulerPackages = schedulers.Triggerable(
name="s_packages", builderNames=getAutobakeBuilderNames
)
l.append(schedulerPackages)
schedulerBigtests = schedulers.Triggerable(
name="s_bigtest", builderNames=getBigtestBuilderNames
)
l.append(schedulerBigtests)
schedulerInstall = schedulers.Triggerable(
name="s_install", builderNames=getInstallBuilderNames
)
l.append(schedulerInstall)
schedulerUpgrade = schedulers.Triggerable(
name="s_upgrade", builderNames=getUpgradeBuilderNames
)
l.append(schedulerUpgrade)
schedulerEco = schedulers.Triggerable(name="s_eco", builderNames=getEcoBuilderNames)
l.append(schedulerEco)
schedulerDockerlibrary = schedulers.Triggerable(
name="s_dockerlibrary", builderNames=getDockerLibraryNames
)
l.append(schedulerDockerlibrary)
l.append(schedulers.Triggerable(name="s_wordpress", builderNames=getWordpressNames))
l.append(
schedulers.Triggerable(name="s_release_prep", builderNames=["release-prep"])
)
l.append(
schedulers.Triggerable(
name="s_jepsen", builderNames=["amd64-ubuntu-2204-jepsen-mariadb"]
)
)
return l