[SCM] build.samba.org - branch master updated
Jelmer Vernooij
jelmer at samba.org
Mon Aug 18 14:11:29 MDT 2014
The branch, master has been updated
via cd17a96 Update Samba build farm to new web site layout.
from 742f79b http -> https
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit cd17a9658a2dbe90a881d36f27ad22d35e777fd6
Author: krishnatejaperannagari <krishnatejaperannagari at gmail.com>
Date: Mon Aug 18 22:07:38 2014 +0200
Update Samba build farm to new web site layout.
Reviewed-By: Jelmer Vernooij <jelmer at samba.org>
-----------------------------------------------------------------------
Summary of changes:
.gitmodules | 3 +
buildfarm/tests/test_util.py | 19 +++-
buildfarm/util.py | 24 ++++
buildfarm/web/__init__.py | 111 +++++++++++-----
web/about.html | 5 -
web/bannernav1.html | 32 +++++
web/bannernav2.html | 17 +++
web/build_farm.css | 286 +++++++++++++++++++++++++++++++++++++----
web/closingtags.html | 9 ++
web/instructions.html | 19 +--
web/samba-web | 1 +
11 files changed, 445 insertions(+), 81 deletions(-)
create mode 100644 .gitmodules
create mode 100644 web/bannernav1.html
create mode 100644 web/bannernav2.html
create mode 100644 web/closingtags.html
create mode 160000 web/samba-web
Changeset truncated at 500 lines:
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..765c2d8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "web/samba-web"]
+ path = web/samba-web
+ url = https://git.samba.org/samba-web.git
diff --git a/buildfarm/tests/test_util.py b/buildfarm/tests/test_util.py
index a727ee2..fbd8f24 100755
--- a/buildfarm/tests/test_util.py
+++ b/buildfarm/tests/test_util.py
@@ -40,7 +40,7 @@ class LoadTests(testtools.TestCase):
f = os.fdopen(fd, 'w')
f.write("""one
two
-three
+three
for
""")
@@ -49,4 +49,21 @@ for
self.assertEquals(4, len(l))
self.assertEquals("three", l[2])
+class SambaWebFileLoadTest(testtools.TestCase):
+
+ def test_simple(self):
+ fd, name = tempfile.mkstemp()
+ self.addCleanup(os.remove, name)
+ f = os.fdopen(fd, 'w')
+ f.write('href="/samba/index.html"')
+ f.close()
+ l = util.SambaWebFileLoad(os.getcwd(),name)
+ self.assertEquals('href="http://www.samba.org/samba/index.html"', l)
+ fd1, name1 = tempfile.mkstemp()
+ self.addCleanup(os.remove, name1)
+ f1 = os.fdopen(fd1, 'w')
+ f1.write('<!--#include virtual="/samba/name2" -->')
+ f1.close()
+ l1 = util.SambaWebFileLoad(os.path.dirname(os.path.realpath("name1")),name1)
+ self.assertEquals('', l1)
diff --git a/buildfarm/util.py b/buildfarm/util.py
index 9d6c8ca..9ce71ca 100644
--- a/buildfarm/util.py
+++ b/buildfarm/util.py
@@ -17,6 +17,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+import re
+import os
+
def load_list(fname):
"""load a list from a file, using : to separate"""
ret = []
@@ -40,6 +43,27 @@ def FileLoad(filename):
finally:
f.close()
+def SambaWebFileLoad(webdir, filename):
+ """loads file and changes the links to suit buildfarm"""
+ try:
+ f = open(os.path.join(webdir, filename), 'r')
+ text = f.read()
+ except IOError:
+ return ''
+ else:
+ f.close()
+ def add_virtual_headers(m):
+ try:
+ f = open(os.path.join(webdir, m.group(1)), 'r')
+ text = f.read()
+ except:
+ return ''
+ else:
+ f.close()
+ return text
+ text = re.sub('<!--#include virtual="/samba/(.*)" -->',add_virtual_headers , text)
+ text = re.sub('href="/samba', 'href="http://www.samba.org/samba', text)
+ return text
def dhm_time(sec):
"""display a time as days, hours, minutes"""
diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py
index 3b3c38d..8794978 100755
--- a/buildfarm/web/__init__.py
+++ b/buildfarm/web/__init__.py
@@ -55,7 +55,7 @@ import time
import wsgiref.util
webdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "web"))
-GITWEB_BASE = "https://gitweb.samba.org"
+GITWEB_BASE = "//gitweb.samba.org"
HISTORY_HORIZON = 1000
# this is automatically filled in
@@ -418,7 +418,7 @@ class ViewBuildPage(BuildFarmPage):
yield "<h2>Older builds:</h2>\n"
- yield "<table class='real'>\n"
+ yield "<table class='newtable'>\n"
yield "<thead><tr><th>Revision</th><th>Status</th><th>Age</th></tr></thead>\n"
yield "<tbody>\n"
@@ -473,7 +473,7 @@ class ViewBuildPage(BuildFarmPage):
if os.path.exists(host_web_file):
yield util.FileLoad(host_web_file)
- yield "<table class='real'>\n"
+ yield "<table class='newtable'>\n"
yield "<tr><td>Host:</td><td><a href='%s?function=View+Host;host=%s;tree=%s;"\
"compiler=%s#'>%s</a> - %s</td></tr>\n" %\
(myself, build.host, build.tree, build.compiler, build.host, self.buildfarm.hostdb[build.host].platform.encode("utf-8"))
@@ -532,7 +532,7 @@ class ViewBuildPage(BuildFarmPage):
yield "<h2>Build log:</h2>\n"
yield print_log_pretty(log)
- yield "<p><small>Some of the above icons derived from the <a href='https://www.gnome.org'>Gnome Project</a>'s stock icons.</small></p>"
+ yield "<p><small>Some of the above icons derived from the <a href='//www.gnome.org'>Gnome Project</a>'s stock icons.</small></p>"
yield "</div>"
else:
yield "<p>Switch to the <a href='%s?function=View+Build;host=%s;tree=%s;"\
@@ -596,7 +596,7 @@ class ViewRecentBuildsPage(BuildFarmPage):
yield "<div id='recent-builds' class='build-section'>"
yield "<h2>Recent builds of %s (%s branch %s)</h2>" % (tree, t.scm, t.branch)
- yield "<table class='real'>"
+ yield "<table class='newtable'>"
yield "<thead>"
yield "<tr>"
yield "<th><a href='%s;sortby=age' title='Sort by build age'>Age</a></th>" % sorturl
@@ -629,10 +629,10 @@ class ViewRecentBuildsPage(BuildFarmPage):
class ViewHostPage(BuildFarmPage):
def _render_build_list_header(self, host):
- yield "<div class='host summary'>"
+ yield "<div>"
yield "<a id='host' name='host'/>"
- yield "<h3>%s - %s</h3>" % (host.name, host.platform.encode("utf-8"))
- yield "<table class='real'>"
+ yield "<h2>%s - %s</h2>" % (host.name, host.platform.encode("utf-8"))
+ yield "<table class='newtable'>"
yield "<thead><tr><th>Target</th><th>Build<br/>Revision</th><th>Build<br />Age</th><th>Status<br />config/build<br />install/test</th><th>Warnings</th></tr></thead>"
yield "<tbody>"
@@ -698,7 +698,7 @@ class ViewHostPage(BuildFarmPage):
yield "<div class='build-section' id='dead-hosts'>"
yield "<h2>Dead Hosts:</h2>"
- yield "<table class='real'>"
+ yield "<table class='newtable'>"
yield "<thead><tr><th>Host</th><th>OS</th><th>Min Age</th></tr></thead>"
yield "<tbody>"
@@ -758,8 +758,8 @@ class ViewSummaryPage(BuildFarmPage):
yield "<div id='build-counts' class='build-section'>"
yield "<h2>Build counts:</h2>"
- yield "<table class='real'>"
- yield "<thead><tr><th>Tree</th><th>Total</th><th>Broken</th><th>Panic</th><th>Test coverage</th></tr></thead>"
+ yield "<table class='newtable'>"
+ yield "<thead><tr><th>Tree</th><th>Total</th><th>Broken</th><th>Panic</th><th>Test coverage</th><th></th></tr></thead>"
yield "<tbody>"
for tree in sorted(self.buildfarm.trees.keys()):
@@ -824,8 +824,8 @@ class HistoryPage(BuildFarmPage):
<div class=\"diff\">
<span class=\"html\"><a href=\"%s?function=diff;tree=%s;date=%s;%s\">show diffs</a></span>
<br />
- <span class=\"text\"><a href=\"%s?function=text_diff;tree=%s;date=%s;%s\">download diffs</a></span>
- <br />
+ <span class=\"text\"><a href=\"%s?function=text_diff;tree=%s;date=%s;%s\">download diffs</a></span><br />
+ <span class=\"label\">Message:</span><br />
<div class=\"history_log_message\">
<pre>%s</pre>
</div>
@@ -857,8 +857,25 @@ class HistoryPage(BuildFarmPage):
if builds:
yield "<div class=\"builds\">\n"
yield "<span class=\"label\">Builds: </span>\n"
+ yield "<table class=\"buildtable\">"
+ count=1
for build in builds:
+ if count == 1:
+ yield "<tr>"
+ yield "<td>"
yield "%s(%s) " % (build_link(myself, build), host_link(myself, build.host))
+ yield "</td>"
+ if count == 3:
+ yield "</tr>"
+ count = 1
+ else:
+ count = count + 1
+ if count == 2:
+ yield "<td></td>"
+ yield "<td></td>"
+ yield "</tr>"
+ count = 1
+ yield "</table>"
yield "</div>\n"
yield "</div>\n"
@@ -880,7 +897,8 @@ class DiffPage(HistoryPage):
changes = branch.changes_summary(revision)
yield "".join(self.history_row_html(myself, entry, t, changes))
diff = highlight(diff, DiffLexer(), HtmlFormatter())
- yield "<pre>%s</pre>\n" % diff.encode("utf-8")
+ yield "<h2>Diff Result:</h2>"
+ yield "<pre>%s</pre>" % diff.encode("utf-8")
class RecentCheckinsPage(HistoryPage):
@@ -893,7 +911,7 @@ class RecentCheckinsPage(HistoryPage):
authors = {"ALL": "ALL"}
branch = t.get_branch()
re_author = re.compile("^(.*) <(.*)>$")
-
+
for entry in branch.log(limit=HISTORY_HORIZON):
m = re_author.match(entry.author)
authors[m.group(2)] = m.group(1)
@@ -903,11 +921,13 @@ class RecentCheckinsPage(HistoryPage):
yield "<h2>Recent checkins for %s (%s branch %s)</h2>\n" % (
tree, t.scm, t.branch)
yield "<form method='GET'>"
+ yield "<div class='newform'>\n"
yield "Select Author: "
yield "".join(select(name="author", values=authors, default=author))
yield "<input type='submit' name='sub_function' value='Refresh'/>"
yield "<input type='hidden' name='tree' value='%s'/>" % tree
yield "<input type='hidden' name='function', value='Recent Checkins'/>"
+ yield "</div>\n"
yield "</form>"
gitstop = gitstart + self.limit
@@ -930,7 +950,6 @@ class RecentCheckinsPage(HistoryPage):
yield "<input type='hidden' name='tree' value='%s'/>" % tree
yield "</div>\n"
yield "</form>"
- yield "<br>"
class BuildFarmApp(object):
@@ -938,28 +957,33 @@ class BuildFarmApp(object):
def __init__(self, buildfarm):
self.buildfarm = buildfarm
- def main_menu(self, tree, host, compiler):
+ def main_menu(self, tree, host, compiler, function):
"""main page"""
yield "<form method='GET'>\n"
- yield "<div id='build-menu'>\n"
+ yield "<div id='newbuildmenu'>\n"
host_dict = {}
for h in self.buildfarm.hostdb.hosts():
- host_dict[h.name] = "%s -- %s" % (h.platform.encode("utf-8"), h.name)
+ host_dict[h.name] = "%s-%s" % (h.platform.encode("utf-8"), h.name)
yield "".join(select("host", host_dict, default=host))
+ yield "<br/><br/>"
+
tree_dict = {}
for t in self.buildfarm.trees.values():
tree_dict[t.name] = "%s:%s" % (t.name, t.branch)
yield "".join(select("tree", tree_dict, default=tree))
+ yield "<br/><br/>"
yield "".join(select("compiler", dict(zip(self.buildfarm.compilers, self.buildfarm.compilers)), default=compiler))
- yield "<br/>\n"
- yield "<input type='submit' name='function' value='View Build'/>\n"
- yield "<input type='submit' name='function' value='View Host'/>\n"
- yield "<input type='submit' name='function' value='Recent Checkins'/>\n"
- yield "<input type='submit' name='function' value='Summary'/>\n"
- yield "<input type='submit' name='function' value='Recent Builds'/>\n"
- yield "</div>\n"
- yield "</form>\n"
+ yield "<br/><br/>"
+ functions_dict = {
+ 'View Build': 'View Build', 'Summary': 'Summary', 'View Host': 'View Host',
+ 'Recent Builds': 'Recent Builds', 'Recent Checkins': 'Recent Checkins',
+ }
+ yield "".join(select("function", functions_dict, default=function))
+ yield "<br/><br/>"
+ yield "<br/><input type='submit' name='search' value='Go'/>"
+ yield "</div>"
+ yield "</form>"
def html_page(self, form, lines):
yield "<html>\n"
@@ -970,22 +994,29 @@ class BuildFarmApp(object):
yield " <meta name='description' contents='Home of the Samba Build Farm, the automated testing facility.'/>\n"
yield " <meta name='robots' contents='noindex'/>"
yield " <link rel='stylesheet' href='/build_farm.css' type='text/css' media='all'/>"
- yield " <link rel='stylesheet' href='//www.samba.org/samba/style/common.css' type='text/css' media='all'/>"
yield " <link rel='shortcut icon' href='//www.samba.org/samba/images/favicon.ico'/>"
+ yield " <link rel='shortcut icon' href='//www.samba.org/samba/style/2010/grey/favicon.ico'/>"
+ yield " <link rel='stylesheet' type='text/css' media='screen,projection' href='//www.samba.org/samba/style/2010/grey/screen.css'/>"
+ yield " <link rel='stylesheet' type='text/css' media='print' href='//www.samba.org/samba/style/2010/grey/print.css'/> "
yield " </head>"
yield "<body>"
- yield util.FileLoad(os.path.join(webdir, "header2.html"))
-
tree = get_param(form, "tree")
host = get_param(form, "host")
compiler = get_param(form, "compiler")
- yield "".join(self.main_menu(tree, host, compiler))
- yield util.FileLoad(os.path.join(webdir, "header3.html"))
+ function = get_param(form, "function")
+ yield "".join(self.main_menu(tree, host, compiler, function))
+ yield util.FileLoad(os.path.join(webdir, "bannernav1.html"))
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_think_samba_closed.html")
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_get_samba_closed.html")
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_learn_samba_closed.html")
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_talk_samba_closed.html")
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_hack_samba_closed.html")
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "menu_contact_samba_closed.html")
+ yield util.FileLoad(os.path.join(webdir, "bannernav2.html"))
yield "".join(lines)
- yield util.FileLoad(os.path.join(webdir, "footer.html"))
- yield "</body>"
- yield "</html>"
+ yield util.SambaWebFileLoad(os.path.join(webdir, "samba-web"), "footer.html")
+ yield util.FileLoad(os.path.join(webdir, "closingtags.html"))
def __call__(self, environ, start_response):
form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ)
@@ -1076,6 +1107,16 @@ class BuildFarmApp(object):
('Content-type', 'text/html; charset=utf-8')])
page = ViewHostPage(self.buildfarm)
yield "".join(self.html_page(form, page.render_html(myself, wsgiref.util.shift_path_info(environ))))
+ elif fn == "about":
+ start_response('200 OK', [
+ ('Content-type', 'text/html; charset=utf-8')])
+ lines = util.FileLoad(os.path.join(webdir, "about.html"))
+ yield "".join(self.html_page(form, lines))
+ elif fn == "instructions":
+ start_response('200 OK', [
+ ('Content-type', 'text/html; charset=utf-8')])
+ lines = util.FileLoad(os.path.join(webdir, "instructions.html"))
+ yield "".join(self.html_page(form, lines))
elif fn == "build":
build_checksum = wsgiref.util.shift_path_info(environ)
try:
diff --git a/web/about.html b/web/about.html
index acd6825..671772f 100644
--- a/web/about.html
+++ b/web/about.html
@@ -1,7 +1,3 @@
-<!--#include virtual="/header.html"-->
-<title>samba.org build farm - About</title>
-<!--#include virtual="/header2.html"-->
-<!--#include virtual="/header3.html"-->
<h2>About the build farm</h2>
@@ -41,4 +37,3 @@
then please read these <a href="instructions.html">instructions</a>.
</p>
-<!--#include virtual="/footer.html"-->
diff --git a/web/bannernav1.html b/web/bannernav1.html
new file mode 100644
index 0000000..da885c7
--- /dev/null
+++ b/web/bannernav1.html
@@ -0,0 +1,32 @@
+ <div id="newpagestart">
+ <!-- header -->
+ <div id="hd">
+ <div class="noPrint" id="hdScreen">
+
+ <div class="clearing"></div>
+ <div id="newbannerstart"></div>
+ <div class="clearing"></div>
+ </div>
+
+ <div class="noScreen" id="hdPrint">
+ <img src="https://www.samba.org//samba/style/2010/grey/headerPrint.jpg" alt="Samba" id="hdPrintImage">
+ </div>
+ <div class="clearing"></div>
+ </div>
+ <!-- main content -->
+ <div id="bd">
+ <div id="bdCols">
+
+
+
+
+<!-- left column: navigation -->
+<div class="noPrint" id="nav">
+ <ul>
+ <li><a href="https://build.samba.org/">Build Samba</a></li>
+ <ul>
+ <li><a href="https://build.samba.org/build.cgi/about">About the Build Farm</a></li>
+ <li><a href="https://build.samba.org/build.cgi/instructions">Adding a new machine</a></li>
+ <li><a href="https://www.samba.org/">Samba Web pages</a></li>
+ </ul>
+ <br>
diff --git a/web/bannernav2.html b/web/bannernav2.html
new file mode 100644
index 0000000..264c264
--- /dev/null
+++ b/web/bannernav2.html
@@ -0,0 +1,17 @@
+ </ul>
+</div>
+
+<div class="relatedLeft">
+ <div class="relatedLeftContent">
+
+ <h4>Search:</h4>
+ <br><br><br><br><br><br><br><br><br><br>
+
+ </div>
+ <div class="relatedLeftBottom"></div>
+ </div>
+
+
+<!--center-->
+
+<div class="newcontent">
diff --git a/web/build_farm.css b/web/build_farm.css
index 6b8fb01..7a8e3fd 100644
--- a/web/build_farm.css
+++ b/web/build_farm.css
@@ -23,8 +23,9 @@
* no need to remargin
* margin: 5px;*/
padding: 10px;
- border: 2px solid black;
+ border: 1px solid black;
}
+/*
#log div.unit.passed { background-color: rgb(180, 255, 180); }
#log div.unit.failed { background-color: rgb(255, 180, 180); }
#log div.unit.skipped { background-color: rgb(180, 180, 255); }
@@ -34,10 +35,10 @@
#log div.unit.error { background-color: rgb(255, 180, 180); }
#log div.unit.mistake { background-color: rgb(180, 180, 255); }
#log div.unit.pretest.ok { background-color: rgb(180, 255, 180); }
-
-#log .unit.failed .output { display: block;}
-#log .unit.skipped .output { display: block;}
-#log .unit.skipped .output { display: block;}
+*/
+#log .unit.failed .output { display: none;}
+#log .unit.skipped .output { display: none;}
+#log .unit.skipped .output { display: none;}
#log .unit.passed .output { display: none;}
#log .unit.error .output { display: none;}
#log .unit.mistake .output { display: none;}
@@ -47,8 +48,21 @@
#log .unit.errorlog .output { display: none;}
#log .unit.pretest .output { display: none;}
#log div.status.errorlog { display: none;}
-img + div.action.title {margin-left: 0.5em;}
-a + div.action.status {margin-left: 0.5em;}
+img + div.testlinks.title,
+img + div.cc_checker.title,
+img + div.pretest.title,
+img + div.test.title,
+img + div.action.title {
+ margin-left: 0.5em;
+}
+a + div.testlinks.status,
+a + div.cc_checker.status,
+a + div.pretest.status,
+a + div.test.status,
+a + div.action.status {
+ margin-left: 0.5em;
+}
+
#log div.output-stderr-0 {
display: none;
@@ -64,37 +78,37 @@ a + div.action.status {margin-left: 0.5em;}
}
/* generically, status correspond to the ok/ok/ok/ok strings */
-.status.passed {
+.status.passed {
color: rgb(0, 128, 0);
}
-.status.failed {
+.status.failed {
color: rgb(255, 0, 0);
}
-.status.panic {
+.status.panic {
color: rgb(255, 0, 0);
font-weight: bold;
}
-.status.checker {
+.status.checker {
--
build.samba.org
More information about the samba-cvs
mailing list