4
# Licensed to the Apache Software Foundation (ASF) under one
5
# or more contributor license agreements. See the NOTICE file
6
# distributed with this work for additional information
7
# regarding copyright ownership. The ASF licenses this file
8
# to you under the Apache License, Version 2.0 (the
9
# "License"); you may not use this file except in compliance
10
# with the License. You may obtain a copy of the License at
12
# http://www.apache.org/licenses/LICENSE-2.0
14
# Unless required by applicable law or agreed to in writing,
15
# software distributed under the License is distributed on an
16
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
# KIND, either express or implied. See the License for the
18
# specific language governing permissions and limitations
23
import os, os.path, re
25
from buildbot.scheduler import Scheduler
26
from buildbot.process import factory
27
from buildbot.steps import source, shell
28
from buildbot.status.html import WebStatus
29
from buildbot.scheduler import AnyBranchScheduler
30
#from buildbot.twcompat import implements
31
from buildbot.scheduler import Try_Userpass
32
from buildbot.scheduler import Nightly
33
from buildbot.changes.svnpoller import SVNPoller, split_file_branches
34
from buildbot.buildslave import BuildSlave
36
#import TigrisMailSource
37
import SVNMailNotifier
38
from Feeder import WebStatusWithFeeds
41
REPO="http://svn.apache.org/repos/asf/subversion/"
45
# This is the dictionary that the buildmaster pays attention to. We also use
46
# a shorter alias to save typing.
47
c = BuildmasterConfig = {}
50
c['slaves'] = [BuildSlave("fc1-gcc3.3.2-ia32", private.slavePwd),
51
BuildSlave("osx10.4-gcc4.0.1-ia32", private.slavePwd),
52
BuildSlave("xp-vs2003-ia32", private.slavePwd),
53
BuildSlave("dlr-fc3", private.slavePwd),
54
BuildSlave("eh-debsarge1", private.slavePwd),
55
BuildSlave("x64-ubuntu", private.hwrightPwd),
56
BuildSlave("x64-centos", private.wandPwd),
60
c['change_source'] = SVNPoller(REPO,
61
split_file=split_file_branches,
62
svnbin=private.svnbin,
65
excludes = ["COMMITTERS", "STATUS", "CHANGES", "README", "INSTALL", "COPYING", "HACKING", "TRANSLATING", "BUGS", "www", "notes", "packages", "subversion/LICENSE", "subversion/po", "doc", "contrib", "tools", "dist.sh"]
67
# function checks if this revision is interesting enough to trigger the builds.
68
def isImportant(change):
72
for file in change.files:
74
for pattern in excludes:
75
match = re.match(pattern, file)
83
bs1 = AnyBranchScheduler("main",
84
[None, "branches/1.3.x", "branches/1.4.x", "branches/1.5.x",
86
5*60, ["x86-macosx-gnu shared",
87
"debian-x86_64-32 shared gcc",
91
fileIsImportant=isImportant)
93
ps1 = Nightly('daily-2pm-cet', ['x86-macosx-gnu shared daily ra_serf'], hour=14, minute=0)
95
ts = Try_Userpass("try", ["x86-macosx-gnu shared", "debian-x86_64-32 shared gcc"],
96
port=private.tryPort, userpass=[(private.tryUser,private.tryPwd)] )
97
c['schedulers'] = [bs1, ps1, ts]
101
# define default set of steps, all under masters control.
102
defSteps = [shell.ShellCommand(name="Cleanup", command=["../svnclean.sh"], timeout=3600),
103
source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
104
shell.ShellCommand(name="Build", command=["../svnbuild.sh"], logfiles={"configlog": "config.log"}, timeout=3600, haltOnFailure=True),
105
shell.ShellCommand(name="Test fsfs+ra_neon", command=["../svncheck.sh", "fsfs", "ra_neon"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
108
defFact = factory.BuildFactory(defSteps)
110
# define Windows custom steps
111
winSteps = [source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
112
shell.ShellCommand(name="Build", command=["..\svnbuild.bat"], timeout=3600, haltOnFailure=True),
113
shell.ShellCommand(name="Test fsfs+ra_local", command=["..\svncheck.bat","fsfs","ra_local"], timeout=3600, flunkOnFailure=True),
114
shell.ShellCommand(name="Test fsfs+ra_dav", command=["..\svncheck.bat","fsfs","ra_dav"], timeout=3600, flunkOnFailure=True),
115
shell.ShellCommand(name="Test fsfs+ra_svn", command=["..\svncheck.bat","fsfs","ra_svn"], timeout=3600, flunkOnFailure=True),
116
shell.ShellCommand(name="Cleanup", command=["..\svnclean.bat"], timeout=3600),
118
winFact = factory.BuildFactory(winSteps)
120
# define Windows 6 way steps
121
win6wSteps = [source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
122
shell.ShellCommand(name="Cleanup", command=["..\svnclean.bat"], timeout=3600),
123
shell.ShellCommand(name="Build", command=["..\svnbuild.bat", "%(branch)"], timeout=3600, haltOnFailure=True),
124
shell.ShellCommand(name="Test fsfs+ra_local", command=["..\svncheck.bat","fsfs","ra_local"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
126
win6wFact = factory.BuildFactory(win6wSteps)
128
# define set of steps for eh-x84_64-32, clean step comes first.
129
ehSteps = [shell.ShellCommand(name="Cleanup", command=["../svnclean.sh"], workdir='', timeout=3600),
130
source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
131
shell.ShellCommand(name="Build", command=["../svnbuild.sh"], logfiles={"configlog": "config.log"}, timeout=3600, haltOnFailure=True),
132
shell.ShellCommand(name="Test fsfs+ra_svn", command=["../svncheck.sh","fsfs","ra_svn"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
134
ehFact = factory.BuildFactory(ehSteps)
136
# nightly build ra_serf
137
serfSteps = [shell.ShellCommand(name="Cleanup", command=["../svnclean.sh"], timeout=3600),
138
source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
139
shell.ShellCommand(name="Build", command=["../svnbuild.sh"], logfiles={"configlog": "config.log"}, timeout=3600, haltOnFailure=True),
140
shell.ShellCommand(name="Test fsfs+ra_serf", command=["../svncheck.sh", "fsfs", "ra_serf"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
142
serfFact = factory.BuildFactory(serfSteps)
144
# define set of steps for x64-ubuntu, clean step comes first.
145
x64ubSteps = [shell.ShellCommand(name="Cleanup", command=["../svnclean.sh"], workdir='', timeout=3600),
146
source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
147
shell.ShellCommand(name="Build", command=["../svnbuild.sh"], logfiles={"configlog": "config.log"}, timeout=3600, haltOnFailure=True),
148
shell.ShellCommand(name="Test fsfs+ra_local", command=["../svncheck.sh","fsfs","ra_local"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=False),
149
shell.ShellCommand(name="Test bindings", command=["../svncheck-bindings.sh","fsfs","ra_local"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
151
x64ubFact = factory.BuildFactory(x64ubSteps)
153
x64coSteps = [shell.ShellCommand(name="Cleanup", command=["../svnclean.sh"], timeout=3600),
154
source.SVN(baseURL=REPO,defaultBranch='trunk', timeout=3600),
155
shell.ShellCommand(name="Build", command=["../svnbuild.sh"], logfiles={"configlog": "config.log"}, timeout=3600, haltOnFailure=True),
156
shell.ShellCommand(name="Test fsfs+ra_local", command=["../svncheck.sh", "fsfs", "ra_neon"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
157
shell.ShellCommand(name="Test bindings", command=["../svncheck-bindings.sh","fsfs","ra_neon"], logfiles={"testlog": "tests.log"}, timeout=3600, flunkOnFailure=True),
159
x64coFact = factory.BuildFactory(x64coSteps)
163
{'name': "x86-macosx-gnu shared",
164
'slavename': "osx10.4-gcc4.0.1-ia32",
165
'builddir': "osx10.4-gcc4.0.1-ia32",
169
{'name': "debian-x86_64-32 shared gcc",
170
'slavename': "eh-debsarge1",
171
'builddir': "eh-debsarge1",
175
{'name': "x86-macosx-gnu shared daily ra_serf",
176
'slavename': "osx10.4-gcc4.0.1-ia32",
177
'builddir': "osx10.4-gcc4.0.1-ia32-serf",
181
{'name': "x64-ubuntu gcc",
182
'slavename': "x64-ubuntu",
183
'builddir': "x64-ubuntu",
184
'factory': x64ubFact,
187
{'name': "x64-centos gcc",
188
'slavename': "x64-centos",
189
'builddir': "x64-centos",
190
'factory': x64coFact,
195
# 'slavePortnum' defines the TCP port to listen on. This must match the value
196
# configured into the buildslaves (with their --master option)
198
c['slavePortnum'] = private.slavePortnum
202
c['status'].append(WebStatusWithFeeds(http_port="tcp:"+str(private.htmlPort)+":interface=127.0.0.1", allowForce=True))
205
from buildbot.status import mail
206
mailbody = 'Full details are available at: \n%(buildurl)s\n\n'\
207
'Author list: %(blamelist)s\n\n'\
208
'Build Slave: %(slave)s\n\n\n'\
209
'Subversion Buildbot\n'\
210
'%(buildboturl)s\n\n\n'\
211
'Last 100 lines of the build log (step: %(laststep)s ):\n\n %(lastlog)s'
214
c['status'].append(SVNMailNotifier.SVNMailNotifier(
215
fromaddr="buildbot@mobsol.be",
216
extraRecipients=["notifications@subversion.apache.org"],
217
sendToInterestedUsers=False,
218
subject="svn %(branch)s r%(revision)s: %(result)s (%(builder)s)",
220
replytoaddr="dev@subversion.apache.org",
222
relayhost=private.smtp))
224
# from buildbot.status import words
225
# c['status'].append(words.IRC(host="irc.example.com", nick="bb",
226
# channels=["#example"]))
229
# if you set 'debugPassword', then you can connect to the buildmaster with
230
# the diagnostic tool in contrib/debugclient.py . From this tool, you can
231
# manually force builds and inject changes, which may be useful for testing
232
# your buildmaster without actually commiting changes to your repository (or
233
# before you have a functioning 'sources' set up). The debug tool uses the
234
# same port number as the slaves do: 'slavePortnum'.
236
#c['debugPassword'] = "debugpassword"
238
# if you set 'manhole', you can telnet into the buildmaster and get an
239
# interactive python shell, which may be useful for debugging buildbot
240
# internals. It is probably only useful for buildbot developers.
241
# from buildbot.master import Manhole
242
#c['manhole'] = Manhole(9999, "admin", "password")
244
# the 'projectName' string will be used to describe the project that this
245
# buildbot is working on. For example, it is used as the title of the
246
# waterfall HTML page. The 'projectURL' string will be used to provide a link
247
# from buildbot HTML pages to your project's home page.
249
c['projectName'] = "Subversion"
250
c['projectURL'] = "http://subversion.apache.org/"
252
# the 'buildbotURL' string should point to the location where the buildbot's
253
# internal web server (usually the html.Waterfall page) is visible. This
254
# typically uses the port number set in the Waterfall 'status' entry, but
255
# with an externally-visible host name which the buildbot cannot figure out
258
c['buildbotURL'] = "http://crest.ics.uci.edu/buildbot/"