This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
master.cfg
135 lines (115 loc) · 4.04 KB
/
master.cfg
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
#!/usr/bin/env python
# buildbot-ros configuration file
# import relevant parts
from buildbot_ros_cfg.ros_deb import ros_debbuild
from buildbot_ros_cfg.ros_test import ros_testbuild
from buildbot_ros_cfg.ros_doc import ros_docbuild
from buildbot_ros_cfg.launchpad_deb import launchpad_debbuild
from buildbot_ros_cfg.distro import *
from buildbot.schedulers import forcesched, timed
from buildbot.plugins import util
from buildbot.status.web import auth
from buildbot.status import html
from buildbot.buildslave import BuildSlave
from rosdistro import get_index
# BuildMasterConfig
c = BuildmasterConfig = {}
c['title'] = 'Buildbot-ROS'
c['titleURL'] = 'http://github.com/mikeferguson/buildbot-ros'
c['buildbotURL'] = "http://localhost:8010/"
c['builders'] = []
c['change_source'] = []
c['schedulers'] = []
c['db'] = {
# This specifies what database buildbot uses to store its state. You can leave
# this at its default for all but the largest installations.
'db_url' : "sqlite:///state.sqlite",
}
# Web front end
authz_cfg=util.Authz(
# change any of these to True to enable; see the manual for more options
auth=util.BasicAuth([("ros","ros")]),
gracefulShutdown = False,
forceBuild = 'auth',
forceAllBuilds = False,
pingBuilder = False,
stopBuild = False,
stopAllBuilds = False,
cancelPendingBuild = False,
)
c['status'] = []
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
# Build Machines
c['slaves'] = [BuildSlave('rosbuilder1', 'mebuildslotsaros'),
BuildSlave('rosbuilder2', 'mebuildslotsaros')]
c['slavePortnum'] = 9989
BUILDERS = ['rosbuilder1', 'rosbuilder2']
# Pull request builder tokens (should not be stored in rosdistro)
# This is a mapping of "repo" -> "token"
# If a repo has no entry, then pull request builder will not be started
oauth_tokens = dict()
# RosDistro Stuff
rosindex = get_index('https://raw.github.com/mikeferguson/rosdistro-buildbot-example/with-apache/index.yaml')
dist_names = rosindex.distributions.keys()
oracle = RosDistroOracle(rosindex, dist_names)
# Setup jobs
DEB_JOBS = list()
TEST_JOBS = list()
DOC_JOBS = list()
LPD_JOBS = list()
nightlyDebNames = list()
nightlyDocNames = list()
for dist in dist_names:
print('')
print('Configuring for %s' % dist)
# debian builder
DEB_JOBS += debbuilders_from_rosdistro(c, oracle, dist, BUILDERS)
# test jobs, triggered by source commit
TEST_JOBS += testbuilders_from_rosdistro(c, oracle, dist, BUILDERS, oauth_tokens)
# doc jobs
DOC_JOBS = docbuilders_from_rosdistro(c, oracle, dist, BUILDERS)
# get name of first of nightly debuilds for this distro
build_files = get_release_build_files(oracle.getIndex(), dist)
for build_file in build_files:
for os in build_file.get_target_os_names():
for code_name in build_file.get_target_os_code_names(os):
for arch in build_file.get_target_arches(os, code_name):
try:
nightlyDebNames.append(oracle.getNightlyDebStart(dist)+'_'+dist+'_'+code_name+'_'+arch+'_debbuild')
except IndexError:
# No release jobs?
print('No release jobs will be run')
# get name of first nightly docbuilds for this distro
try:
nightlyDocNames.append(oracle.getNightlyDocStart(dist)+'_'+dist+'_docbuild')
except IndexError:
# No documentation jobs?
print('No documentation jobs will be run')
print('')
# Build debs at 2AM
c['schedulers'].append(
timed.Nightly(
name = 'nightly-debbuild',
branch = 'master',
builderNames = nightlyDebNames,
hour=2,
minute=0
)
)
# Build debs at 5AM
if nightlyDocNames:
c['schedulers'].append(
timed.Nightly(
name = 'nightly-docbuild',
branch = 'master',
builderNames = nightlyDocNames,
hour=5,
minute=0
)
)
c['schedulers'].append(
forcesched.ForceScheduler(
name='force',
builderNames=DEB_JOBS+TEST_JOBS+DOC_JOBS+LPD_JOBS
)
)