-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathschedulers_definition.py
121 lines (97 loc) · 3.56 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
from buildbot.interfaces import IProperties
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,
SUPPORTED_PLATFORMS,
)
############################
# SCHEDULER HELPER FUNCTIONS
############################
@util.renderer
def branchBuilders(props: IProperties) -> list[str]:
mBranch = props.getProperty("master_branch")
builders = list(
filter(lambda x: x not in GITHUB_STATUS_BUILDERS, SUPPORTED_PLATFORMS[mBranch])
)
return builders
@util.renderer
def protectedBranchBuilders(props: IProperties) -> list[str]:
mBranch = props.getProperty("master_branch")
builders = list(
filter(lambda x: x in SUPPORTED_PLATFORMS[mBranch], GITHUB_STATUS_BUILDERS)
)
return builders
@util.renderer
def autobakeBuilders(props: IProperties) -> list[str]:
builder_name = props.getProperty("parentbuildername")
for b in BUILDERS_AUTOBAKE:
if builder_name in b:
return [b]
return []
@util.renderer
def bigtestBuilders(props: IProperties) -> list[str]:
builder_name = props.getProperty("parentbuildername")
for b in BUILDERS_BIG:
if builder_name in b:
return [b]
return []
@util.renderer
def installBuilders(props: IProperties) -> list[str]:
builder_name = props.getProperty("parentbuildername")
for b in BUILDERS_INSTALL:
if builder_name in b:
builders = [b]
if "rhel" in builder_name:
builders.append(b.replace("rhel", "almalinux"))
builders.append(b.replace("rhel", "rockylinux"))
return builders
return []
@util.renderer
def upgradeBuilders(props: IProperties) -> list[str]:
builder_name = props.getProperty("parentbuildername")
builders = []
for b in BUILDERS_UPGRADE:
if builder_name in b:
if "rhel" in builder_name:
builders.append(b.replace("rhel", "almalinux"))
builders.append(b.replace("rhel", "rockylinux"))
builders.append(b)
return builders
@util.renderer
def ecoBuilders(props: IProperties) -> list[str]:
builder_name = props.getProperty("parentbuildername")
builders = []
for b in BUILDERS_ECO:
if builder_name in b:
builders.append(b)
return builders
@util.renderer
def dockerLibraryBuilders(props: IProperties) -> list[str]:
return BUILDERS_DOCKERLIBRARY[0]
@util.renderer
def wordpressBuilders(props: IProperties) -> list[str]:
return BUILDERS_WORDPRESS[0]
SCHEDULERS = [
schedulers.Triggerable(name="s_upstream_all", builderNames=branchBuilders),
schedulers.Triggerable(
name="s_protected_branches", builderNames=protectedBranchBuilders
),
schedulers.Triggerable(name="s_packages", builderNames=autobakeBuilders),
schedulers.Triggerable(name="s_bigtest", builderNames=bigtestBuilders),
schedulers.Triggerable(name="s_install", builderNames=installBuilders),
schedulers.Triggerable(name="s_upgrade", builderNames=upgradeBuilders),
schedulers.Triggerable(name="s_eco", builderNames=ecoBuilders),
schedulers.Triggerable(name="s_dockerlibrary", builderNames=dockerLibraryBuilders),
schedulers.Triggerable(name="s_wordpress", builderNames=wordpressBuilders),
schedulers.Triggerable(name="s_release_prep", builderNames=["release-prep"]),
schedulers.Triggerable(
name="s_jepsen", builderNames=["amd64-ubuntu-2204-jepsen-mariadb"]
),
]