Author: Matti Picus <[email protected]>
Branch: add-header-to-nightly
Changeset: r874:600464fa69ba
Date: 2013-11-04 19:30 +0200
http://bitbucket.org/pypy/buildbot/changeset/600464fa69ba/
Log: add a header line of links to the nightly listing pages
diff --git a/bot2/pypybuildbot/pypylist.py b/bot2/pypybuildbot/pypylist.py
--- a/bot2/pypybuildbot/pypylist.py
+++ b/bot2/pypybuildbot/pypylist.py
@@ -6,6 +6,7 @@
import urllib
import sys
from twisted.web.static import File, DirectoryLister
+from buildbot.status.web.base import path_to_root
class PyPyTarball(object):
@@ -145,7 +146,7 @@
Listener = PyPyDirectoryLister
else:
names = self.sortDirectoryNames(File.listEntities(self))
- Listener = DirectoryLister
+ Listener = PyPyDirectoryLister
return Listener(self.path,
names,
self.contentTypes,
@@ -158,7 +159,10 @@
class PyPyDirectoryLister(DirectoryLister):
template = """<html>
<head>
-<title>%(header)s</title>
+<title>%%(header)s</title>
+ <link rel="stylesheet" href="%(path_to_root)sdefault.css" type="text/css"
/>
+ <link rel="alternate" type="application/rss+xml" title="RSS"
href="%(path_to_root)srss">
+ <link rel="shortcut icon" href="%(path_to_root)sfavicon.ico">
<style>
.even { background-color: #eee }
.odd { background-color: #dedede }
@@ -180,7 +184,7 @@
.listing {
margin-left: auto;
margin-right: auto;
- width: 50%%;
+ width: 50%%%%;
padding: 0.1em;
}
@@ -191,8 +195,29 @@
</style>
</head>
-<body>
-<h1>%(header)s</h1>
+<body class="interface">
+ <div class="header">
+ <a href="%(path_to_root)s">Home</a>
+ -
+ <!-- PyPy specific items -->
+ <a href="http://speed.pypy.org/">Speed</a>
+ <a href="%(path_to_root)ssummary?branch=<trunk>">Summary
(trunk)</a>
+ <a href="%(path_to_root)ssummary">Summary</a>
+ <a href="%(path_to_root)snightly/">Nightly builds</a>
+ <!-- end of PyPy specific items -->
+
+ <a href="%(path_to_root)swaterfall">Waterfall</a>
+ <!-- <a href="%(path_to_root)sgrid">Grid</a> -->
+ <!-- <a href="%(path_to_root)stgrid">T-Grid</a> -->
+ <!-- <a href="%(path_to_root)sconsole">Console</a> -->
+ <a href="%(path_to_root)sbuilders">Builders</a>
+ <!-- <a href="%(path_to_root)sone_line_per_build">Recent Builds</a> -->
+ <!-- <a href="%(path_to_root)sbuildslaves">Buildslaves</a> -->
+ <!-- <a href="%(path_to_root)schanges">Changesources</a> -->
+ <!-- - <a href="%(path_to_root)sjson/help">JSON API</a> -->
+ - <a href="%(path_to_root)sabout">About</a>
+ </div>
+<h1>%%(header)s</h1>
<table>
<thead>
@@ -205,7 +230,7 @@
</tr>
</thead>
<tbody>
-%(tableContent)s
+%%(tableContent)s
</tbody>
</table>
@@ -224,6 +249,7 @@
def render(self, request):
self.status = request.site.buildbot_service.getStatus()
+ self.template = self.template % {'path_to_root': path_to_root(request)}
return DirectoryLister.render(self, request)
def _buildTableContent(self, elements):
diff --git a/slave/buildbot.tac b/slave/buildbot.tac
--- a/slave/buildbot.tac
+++ b/slave/buildbot.tac
@@ -1,56 +1,44 @@
-# -*- mode: python -*-
+
+import os
+
from twisted.application import service
-try:
- # 8.x
- from buildslave.bot import BuildSlave
-except ImportError:
- #7.x
- from buildbot.slave.bot import BuildSlave
+from buildslave.bot import BuildSlave
-# ---------------------------------------------------------------
-# manual editing of the automatically generated buildbot.tac
-#
-import os.path
-thisfile = os.path.join(os.getcwd(), __file__)
-basedir = os.path.abspath(os.path.dirname(thisfile))
-#
-# ---------------------------------------------------------------
+basedir = r'/home/matti/pypy_stuff/buildbot/slave'
+rotateLength = 10000000
+maxRotatedFiles = 10
-def find_passwd(slavename):
- masterdir = os.path.join(basedir, '..', 'master')
- slaveinfo = os.path.join(masterdir, 'slaveinfo.py')
- d = {}
- try:
- execfile(slaveinfo, d)
- return d['passwords'][slavename]
- except Exception, e:
- print 'error when executing ../master/slaveinfo.py: %s' % repr(e)
- print 'using default password for the slave'
- return 'default_password'
-
+# if this is a relocatable tac file, get the directory containing the TAC
+if basedir == '.':
+ import os.path
+ basedir = os.path.abspath(os.path.dirname(__file__))
-buildmaster_host = 'localhost'
-port = 10407
-slavename = 'localhost'
-passwd = find_passwd(slavename)
-keepalive = 600
-usepty = 0
-umask = None
-maxdelay = 300
-rotateLength = 1000000
-maxRotatedFiles = None
+# note: this line is matched against to check that this is a buildslave
+# directory; do not edit it.
+application = service.Application('buildslave')
-application = service.Application('buildslave')
try:
from twisted.python.logfile import LogFile
from twisted.python.log import ILogObserver, FileLogObserver
- logfile = LogFile.fromFullPath("twistd.log", rotateLength=rotateLength,
+ logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"),
rotateLength=rotateLength,
maxRotatedFiles=maxRotatedFiles)
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
except ImportError:
# probably not yet twisted 8.2.0 and beyond, can't set log yet
pass
+
+buildmaster_host = 'localhost'
+port = 10407
+slavename = 'localhost'
+passwd = 'stam'
+keepalive = 600
+usepty = 0
+umask = None
+maxdelay = 300
+allow_shutdown = None
+
s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
- keepalive, usepty, umask=umask, maxdelay=maxdelay)
+ keepalive, usepty, umask=umask, maxdelay=maxdelay,
+ allow_shutdown=allow_shutdown)
s.setServiceParent(application)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit