Skip to content

Commit

Permalink
Merge commit 'ea17f9cf8c95867da1eb015ed07b7037b2232b3b' into jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sonestedt committed Dec 19, 2009
2 parents 101db85 + ea17f9c commit 1542ae5
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 34 deletions.
2 changes: 1 addition & 1 deletion buildbot/changes/p4poller.py
Expand Up @@ -31,7 +31,7 @@ class P4Source(base.ChangeSource, util.ComparableMixin):
"p4bin", "pollinterval"]

changes_line_re = re.compile(
r"Change (?P<num>\d+) on \S+ by \S+@\S+ '.+'$")
r"Change (?P<num>\d+) on \S+ by \S+@\S+ '.*'$")
describe_header_re = re.compile(
r"Change \d+ by (?P<who>\S+)@\S+ on (?P<when>.+)$")
file_re = re.compile(r"^\.\.\. (?P<path>[^#]+)#\d+ \w+$")
Expand Down
54 changes: 23 additions & 31 deletions buildbot/scripts/runner.py
Expand Up @@ -160,7 +160,7 @@ def sampleconfig(self, source):
f.close()
os.chmod(target, 0600)

def public_html(self, index_html, buildbot_css, robots_txt):
def public_html(self, files):
webdir = os.path.join(self.basedir, "public_html")
if os.path.exists(webdir):
if not self.quiet:
Expand All @@ -170,20 +170,11 @@ def public_html(self, index_html, buildbot_css, robots_txt):
os.mkdir(webdir)
if not self.quiet:
print "populating public_html/"
target = os.path.join(webdir, "index.html")
f = open(target, "wt")
f.write(open(index_html, "rt").read())
f.close()

target = os.path.join(webdir, "buildbot.css")
f = open(target, "wt")
f.write(open(buildbot_css, "rt").read())
f.close()

target = os.path.join(webdir, "robots.txt")
f = open(target, "wt")
f.write(open(robots_txt, "rt").read())
f.close()
for target, source in files.iteritems():
target = os.path.join(webdir, target)
f = open(target, "wt")
f.write(open(source, "rt").read())
f.close()

def populate_if_missing(self, target, source, overwrite=False):
new_contents = open(source, "rt").read()
Expand All @@ -206,18 +197,15 @@ def populate_if_missing(self, target, source, overwrite=False):
print "populating %s" % target
open(target, "wt").write(new_contents)

def upgrade_public_html(self, index_html, buildbot_css, robots_txt):
def upgrade_public_html(self, files):
webdir = os.path.join(self.basedir, "public_html")
if not os.path.exists(webdir):
if not self.quiet:
print "populating public_html/"
os.mkdir(webdir)
self.populate_if_missing(os.path.join(webdir, "index.html"),
index_html)
self.populate_if_missing(os.path.join(webdir, "buildbot.css"),
buildbot_css)
self.populate_if_missing(os.path.join(webdir, "robots.txt"),
robots_txt)
for target, source in files.iteritems():
self.populate_if_missing(os.path.join(webdir, target),
source)

def check_master_cfg(self):
from buildbot.master import BuildMaster
Expand Down Expand Up @@ -300,12 +288,14 @@ def upgradeMaster(config):
m = Maker(config)
# TODO: check Makefile
# TODO: check TAC file
# check web files: index.html, classic.css, robots.txt
# check web files: index.html, default.css, robots.txt
webdir = os.path.join(basedir, "public_html")
m.upgrade_public_html(util.sibpath(__file__, "../status/web/index.html"),
util.sibpath(__file__, "../status/web/classic.css"),
util.sibpath(__file__, "../status/web/robots.txt"),
)
m.upgrade_public_html({
'index.html' : util.sibpath(__file__, "../status/web/index.html"),
'bg_gradient.jpg' : util.sibpath(__file__, "../status/web/bg_gradient.jpg"),
'buildbot.css' : util.sibpath(__file__, "../status/web/default.css"),
'robots.txt' : util.sibpath(__file__, "../status/web/robots.txt"),
})
m.populate_if_missing(os.path.join(basedir, "master.cfg.sample"),
util.sibpath(__file__, "sample.cfg"),
overwrite=True)
Expand Down Expand Up @@ -382,10 +372,12 @@ def createMaster(config):
contents = masterTAC % config
m.makeTAC(contents)
m.sampleconfig(util.sibpath(__file__, "sample.cfg"))
m.public_html(util.sibpath(__file__, "../status/web/index.html"),
util.sibpath(__file__, "../status/web/classic.css"),
util.sibpath(__file__, "../status/web/robots.txt"),
)
m.public_html({
'index.html' : util.sibpath(__file__, "../status/web/index.html"),
'bg_gradient.jpg' : util.sibpath(__file__, "../status/web/bg_gradient.jpg"),
'buildbot.css' : util.sibpath(__file__, "../status/web/default.css"),
'robots.txt' : util.sibpath(__file__, "../status/web/robots.txt"),
})
m.makefile()

if not m.quiet: print "buildmaster configured in %s" % m.basedir
Expand Down
6 changes: 5 additions & 1 deletion buildbot/slave/commands.py
Expand Up @@ -17,7 +17,7 @@
# this used to be a CVS $-style "Revision" auto-updated keyword, but since I
# moved to Darcs as the primary repository, this is updated manually each
# time this file is changed. The last cvs_ver that was here was 1.51 .
command_version = "2.8"
command_version = "2.9"

# version history:
# >=1.17: commands are interruptable
Expand Down Expand Up @@ -1808,6 +1808,7 @@ class SVN(SourceBase):
['keep_on_purge']: Files and directories to keep between updates
['ignore_ignores']: Ignore ignores when purging changes
['always_purge']: Always purge local changes after each build
['depth']: Pass depth argument to subversion 1.5+
"""

header = "svn operation"
Expand All @@ -1830,6 +1831,9 @@ def setup(self, args):
if args.get('extra_args', None) is not None:
self.svn_args.extend(args['extra_args'])

if args.has_key('depth'):
self.svn_args.extend(["--depth",args['depth']])

def _dovccmd(self, command, args, rootdir=None, cb=None, **kwargs):
if rootdir is None:
rootdir = os.path.join(self.builder.basedir, self.srcdir)
Expand Down
Binary file added buildbot/status/web/bg_gradient.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions buildbot/status/web/default.css
@@ -0,0 +1,130 @@
body {
margin-left: 30px;
margin-right: 30px;
margin-top: 20px;
padding: 0;
background: url(/bg_gradient.jpg) repeat-x;
font: 12px/18px "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif;
background-color: #fff;
color: #333;
}

a:link,a:visited,a:active {
color: #444;
}

table {
border-spacing: 1px 1px;
}

table td {
padding: 3px 0px 3px 0px;
text-align: center;
}

.Project {
width: 100px;
}

.LastBuild, .Activity {
width: 230px;
padding: 0 0 0 4px;
}

td.Time {
color: #000;
border-bottom: 1px solid #aaa;
background-color: #eee;
}

td.Activity, td.Change, td.Builder {
color: #333333;
background-color: #CCCCCC;
}

td.Change {
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
td.Event {
color: #777;
background-color: #ddd;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}

td.Activity {
border-top-left-radius: 10px;
-webkit-border-top-left-radius: 10px;
-moz-border-radius-topleft: 10px;
min-height: 20px;
padding: 8px 0 8px 0;
}

td.idle, td.waiting, td.offline, td.building {
border-top-left-radius: 0px;
-webkit-border-top-left-radius: 0px;
-moz-border-radius-topleft: 0px;
}

td.builder {
width: 150px;
color: #333333;
background-color: #CCCCCC;
}

td.sourcestamp {
width: 80px;
vertical-align: middle;
}

.LastBuild {
border-top-left-radius: 5px;
-webkit-border-top-left-radius: 5px;
-moz-border-radius-topleft: 5px;
border-top-right-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topright: 5px;
}

/* LastBuild, BuildStep states */
.success {
color: #FFFFFF;
background-color: #8fdf5f;
}

.failure {
color: #FFFFFF;
background-color: #e98080;
}

.warnings {
color: #FFFFFF;
background-color: #ffc343;
}

.exception, td.offline {
color: #FFFFFF;
background-color: #e0b0ff;
}

.start,.running, td.building {
color: #666666;
background-color: #fffc6c;
}

.start {
border-bottom-left-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-right-radius: 10px;
-webkit-border-bottom-right-radius: 10px;
-moz-border-radius-bottomright: 10px;
}

td.Project a:hover, td.start a:hover {
color: #000;
}

15 changes: 14 additions & 1 deletion buildbot/steps/source.py
Expand Up @@ -368,7 +368,7 @@ class SVN(Source):
def __init__(self, svnurl=None, baseURL=None, defaultBranch=None,
directory=None, username=None, password=None,
extra_args=None, keep_on_purge=None, ignore_ignores=None,
always_purge=None, **kwargs):
always_purge=None, depth=None, **kwargs):
"""
@type svnurl: string
@param svnurl: the URL which points to the Subversion server,
Expand Down Expand Up @@ -408,6 +408,7 @@ def __init__(self, svnurl=None, baseURL=None, defaultBranch=None,
self.keep_on_purge = keep_on_purge
self.ignore_ignores = ignore_ignores
self.always_purge = always_purge
self.depth = depth

Source.__init__(self, **kwargs)
self.addFactoryArguments(svnurl=svnurl,
Expand All @@ -420,6 +421,7 @@ def __init__(self, svnurl=None, baseURL=None, defaultBranch=None,
keep_on_purge=keep_on_purge,
ignore_ignores=ignore_ignores,
always_purge=always_purge,
depth=depth,
)

if not svnurl and not baseURL:
Expand Down Expand Up @@ -491,6 +493,17 @@ def startVC(self, branch, revision, patch):
self.args['revision'] = revision
self.args['patch'] = patch

#Set up depth if specified
if self.depth is not None:
if self.slaveVersionIsOlderThan("svn","2.9"):
m = ("This buildslave (%s) does not support svn depth "
"arguments. "
"Refusing to build. "
"Please upgrade the buildslave." % (self.build.slavename))
raise BuildSlaveTooOldError(m)
else:
self.args['depth'] = self.depth

if self.username is not None or self.password is not None:
if self.slaveVersionIsOlderThan("svn", "2.8"):
m = ("This buildslave (%s) does not support svn usernames "
Expand Down
5 changes: 5 additions & 0 deletions docs/buildbot.texinfo
Expand Up @@ -5241,6 +5241,11 @@ svn:ignore properties and global-ignores in subversion/config.
(optional): if set to True, always purge local changes after each
build. This is everything that would appear in a @code{svn status}.

@item depth
(optional): Specify depth argument to achieve sparse checkout. Only available if slave has Subversion 1.5 or higher.

If set to "empty" updates will not pull in any files or subdirectories not already present. If set to "files", updates will pull in any files not already present, but not directories. If set to "immediates", updates willl pull in any files or subdirectories not already present, the new subdirectories will have depth: empty. If set to "infinity", updates will pull in any files or subdirectories not already present; the new subdirectories will have depth-infinity. Infinity is equivalent to SVN default update behavior, without specifying any depth argument.

@end table

If you are using branches, you must also make sure your
Expand Down

0 comments on commit 1542ae5

Please sign in to comment.