From: krishnatejaperannagari Date: Mon, 18 Aug 2014 20:07:38 +0000 (+0200) Subject: Update Samba build farm to new web site layout. X-Git-Url: http://git.samba.org/?p=build-farm.git;a=commitdiff_plain;h=cd17a9658a2dbe90a881d36f27ad22d35e777fd6 Update Samba build farm to new web site layout. Reviewed-By: Jelmer Vernooij --- diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..765c2d8b --- /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 a727ee28..fbd8f247 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('') + 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 9d6c8ca4..9ce71ca1 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('',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 3b3c38d4..8794978b 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 "

Older builds:

\n" - yield "\n" + yield "
\n" yield "\n" yield "\n" @@ -473,7 +473,7 @@ class ViewBuildPage(BuildFarmPage): if os.path.exists(host_web_file): yield util.FileLoad(host_web_file) - yield "
RevisionStatusAge
\n" + yield "
\n" yield "\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 "

Build log:

\n" yield print_log_pretty(log) - yield "

Some of the above icons derived from the Gnome Project's stock icons.

" + yield "

Some of the above icons derived from the Gnome Project's stock icons.

" yield "" else: yield "

Switch to the " yield "

Recent builds of %s (%s branch %s)

" % (tree, t.scm, t.branch) - yield "
Host:%s - %s
" + yield "
" yield "" yield "" yield "" % sorturl @@ -629,10 +629,10 @@ class ViewRecentBuildsPage(BuildFarmPage): class ViewHostPage(BuildFarmPage): def _render_build_list_header(self, host): - yield "
Age
" + yield "

%s - %s

" % (host.name, host.platform.encode("utf-8")) + yield "
" yield "" yield "" @@ -698,7 +698,7 @@ class ViewHostPage(BuildFarmPage): yield "
" yield "

Dead Hosts:

" - yield "
TargetBuild
Revision
Build
Age
Status
config/build
install/test
Warnings
" + yield "
" yield "" yield "" @@ -758,8 +758,8 @@ class ViewSummaryPage(BuildFarmPage): yield "
" yield "

Build counts:

" - yield "
HostOSMin Age
" - yield "" + yield "
TreeTotalBrokenPanicTest coverage
" + yield "" yield "" for tree in sorted(self.buildfarm.trees.keys()): @@ -824,8 +824,8 @@ class HistoryPage(BuildFarmPage):
show diffs
- download diffs -
+ download diffs
+ Message:
%s
@@ -857,8 +857,25 @@ class HistoryPage(BuildFarmPage): if builds: yield "
\n" yield "Builds: \n" + yield "
TreeTotalBrokenPanicTest coverage
" + count=1 for build in builds: + if count == 1: + yield "" + yield "" + if count == 3: + yield "" + count = 1 + else: + count = count + 1 + if count == 2: + yield "" + yield "" + yield "" + count = 1 + yield "
" yield "%s(%s) " % (build_link(myself, build), host_link(myself, build.host)) + yield "
" yield "\n" yield "\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 "
%s
\n" % diff.encode("utf-8") + yield "

Diff Result:

" + yield "
%s
" % 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 "

Recent checkins for %s (%s branch %s)

\n" % ( tree, t.scm, t.branch) yield "
" + yield "
\n" yield "Select Author: " yield "".join(select(name="author", values=authors, default=author)) yield "" yield "" % tree yield "" + yield "
\n" yield "
" gitstop = gitstart + self.limit @@ -930,7 +950,6 @@ class RecentCheckinsPage(HistoryPage): yield "" % tree yield "\n" yield "" - yield "
" 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 "
\n" - yield "
\n" + yield "
\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 "

" + 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 "

" yield "".join(select("compiler", dict(zip(self.buildfarm.compilers, self.buildfarm.compilers)), default=compiler)) - yield "
\n" - yield "\n" - yield "\n" - yield "\n" - yield "\n" - yield "\n" - yield "
\n" - yield "\n" + yield "

" + 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 "

" + yield "
" + yield "
" + yield "" def html_page(self, form, lines): yield "\n" @@ -970,22 +994,29 @@ class BuildFarmApp(object): yield " \n" yield " " yield " " - yield " " yield " " + yield " " + yield " " + yield " " yield " " yield "" - 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 "" - yield "" + 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 acd6825d..671772fc 100644 --- a/web/about.html +++ b/web/about.html @@ -1,7 +1,3 @@ - -samba.org build farm - About - -

About the build farm

@@ -41,4 +37,3 @@ then please read these instructions.

- diff --git a/web/bannernav1.html b/web/bannernav1.html new file mode 100644 index 00000000..da885c7d --- /dev/null +++ b/web/bannernav1.html @@ -0,0 +1,32 @@ +
+ +
+
+ +
+
+
+
+ +
+ Samba +
+
+
+ +
+
+ + + + + + + +
+
+ +

Search:

+









+ +
+
+
+ + + + +
diff --git a/web/build_farm.css b/web/build_farm.css index 6b8fb010..7a8e3fd0 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 { color: rgb(255, 127, 0); } -.status.unknown { +.status.unknown { color: rgb(0, 0, 255); } -.summary td.status { +.summary td.status { text-align: center; } -.summary .tree { +.summary .tree { font-weight: bold; } -.summary .age { +.summary .age { text-align: right; } -.age .old { +.age .old { color: rgb(210, 0, 0); } .preformated { @@ -105,17 +119,17 @@ a + div.action.status {margin-left: 0.5em;} div.host.summary { float: left; } -div.host.summary h3 { +div.host.summary h3 { margin-bottom: 2px; } -div.summary { +div.summary { margin: 4px; } -div.build-section { +div.build-section { clear: both; width: 100%; } -#logo>.build_logo { +#logo>.build_logo { background-image:url(build_logo.png); background-position:center; background-repeat:no-repeat; @@ -126,7 +140,7 @@ div.build-section { height:208px; margin-top:-42px; margin-left:1px; - z-index:1; + z-index:1; } #banner { @@ -151,14 +165,14 @@ div.build-section { border-bottom:2px solid #575756; } -#build-menu { +#build-menu { position: absolute; top: 0; left: 250px; margin-top: 5px; z-index: 10; } -#build-menu input { +#build-menu input { margin: 20px 10px 0px 0px; } @@ -169,7 +183,7 @@ div.build-section { left:175px; margin:0; } -.center { +.center { margin:100px 10px 0 175px; padding-top:30px; padding-left:35px; @@ -208,14 +222,19 @@ div.build-section { color: green; } -.history_row { - background-color: #E5E9F5; - margin-bottom: 10px; +.history_row { + margin-bottom: 30px; padding: 2px; + line-height: 160%; } .history_row .label { - font-style: italic; + font-weight: bold; + color: #c90000; +} + +.history_row .date{ + color: #c90000; } .history_row .date, @@ -225,3 +244,214 @@ div.build-section { .reason { font-weight: bold; } + + + +/*css for new samba look*/ +table.newtable{ + margin-left: auto; + margin-right: auto; +} + +table.newtable, +table.newtable th, +table.newtable td { + border: 1px solid black; + padding: 5px; + text-align: center; + vertical-align: center; +} + +table.newtable th{ + color: #c90000; + font-weight: bold; +} + +table.buildtable{ + margin-left: auto; + margin-right: auto; +} + +table.buildtable td{ + border: 0px; + padding: 10px; + text-align: left; + vertical-align: center; +} + +/*center box includes sitemap*/ +.newcontent{ + position: absolute; + top: 166px; + left: 166px; + right: 266px; + float: left; + text-align: justify; +} + +.newcontent pre{ + overflow-x: auto; + overflow-y: hidden; + font-size: 15px; + font-weight: normal; + font-family:"Times New Roman", Times, serif; + line-height: 22px; +} + +pre::-webkit-scrollbar-track +{ + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); + border-radius: 10px; + background-color: #F5F5F5; +} + +pre::-webkit-scrollbar +{ + width: 12px; + background-color: #F5F5F5; +} + +pre::-webkit-scrollbar-thumb +{ + border-radius: 10px; + -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3); + background-color: #D62929; +} + +/*sitemap*/ +#bd #newsitemap { + float: left; + width: 100%; + margin: 21px 0 25px; +} + +/*removes width applicable for entire page*/ +#page, +#newpagestart { + background-image: url(https://www.samba.org/samba/style/2010/grey/bg.jpg); + background-position: 0 0; + background-repeat: no-repeat; +} + + +#newpagestart h1 { + color: #c90000; + font-size: 46px; + font-weight: normal; + font-family: Georgia, serif; + line-height: 58px; + margin: 0; + padding: 0; +} + +#newpagestart h2 { + color: #c90000; + font-size: 24px; + font-weight: normal; + line-height: 32px; + margin: 0 0 16px; +} + + +#newpagestart h3 { + color: #c90000; + font-size: 24px; + font-weight: normal; + line-height: 28px; + margin: 0; +} + +/*new banner*/ +#hd #newbannerstart { + background-image: url("https://www.samba.org/samba/style/2010/grey/bgHeader.png"); + background-size: 100% 139px; + background-position: 0px 0px; + float: right; + height: 139px; + width: 100%; + background-repeat: no-repeat; +} + +/*form*/ +#newbuildmenu{ + position: absolute; + left: 15px; + top: 590px; + z-index: 10; + font-size: 13px; + line-height: 70%; +} + +#newbuildmenu select{ + width: 110px; + + margin: 0; + -webkit-border-radius:4px; + -moz-border-radius:4px; + border-radius:4px; + -webkit-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; + -moz-box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; + box-shadow: 0 3px 0 #ccc, 0 -1px #fff inset; + background: #d9d9d9; + color:#333333; + border:none; + outline:none; + display: inline-block; + -webkit-appearance:none; + -moz-appearance:none; + appearance:none; + cursor:pointer; +} + +.newform button, +.newform input, +#newbuildmenu input{ + border: 1px solid #df0909; -webkit-border-radius: 3px; -moz-border-radius: 3px;border-radius: 3px;font-size:12px;font-family:arial, helvetica, sans-serif; padding: 0px 2px 0px 2px; text-decoration:none; display:inline-block;text-shadow: -1px -1px 0 rgba(0,0,0,0.3);font-weight:bold; color: #FFFFFF; + background-color: #f62b2b; background-image: -webkit-gradient(linear, left top, left bottom, from(#f62b2b), to(#d20202)); + background-image: -webkit-linear-gradient(top, #f62b2b, #d20202); + background-image: -moz-linear-gradient(top, #f62b2b, #d20202); + background-image: -ms-linear-gradient(top, #f62b2b, #d20202); + background-image: -o-linear-gradient(top, #f62b2b, #d20202); + background-image: linear-gradient(to bottom, #f62b2b, #d20202);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#f62b2b, endColorstr=#d20202); +} + +.newform button:hover, +.newform input:hover, +#newbuildmenu input:hover{ + border: 1px solid #b30808; + background-color: #e40a0a; background-image: -webkit-gradient(linear, left top, left bottom, from(#e40a0a), to(#9f0202)); + background-image: -webkit-linear-gradient(top, #e40a0a, #9f0202); + background-image: -moz-linear-gradient(top, #e40a0a, #9f0202); + background-image: -ms-linear-gradient(top, #e40a0a, #9f0202); + background-image: -o-linear-gradient(top, #e40a0a, #9f0202); + background-image: linear-gradient(to bottom, #e40a0a, #9f0202);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#e40a0a, endColorstr=#9f0202); +} + +.relatedLeft{ + position: absolute; + top: 540px; + left: 2px; + width: 140px; + background-image: url("https://www.samba.org/samba/style/2010/grey/bgBoxSpecial.gif"); + background-size: 140px auto; +} + +.relatedLeftContent h4{ + color: #c90000; + font-size: 18px; + font-weight: normal; + font-family: Georgia, serif; + line-height: 20px; + position: relative; + left: 30px; + top: 20px; + margin: 0 0 16px; +} + +.relatedLeftBottom{ + position: absolute; + width: 140px; + height: 16px; + background-image: url("https://www.samba.org/samba/style/2010/grey/bgBoxSpecialBottom.gif"); + background-size: 140px 16px; +} diff --git a/web/closingtags.html b/web/closingtags.html new file mode 100644 index 00000000..8c8b68c5 --- /dev/null +++ b/web/closingtags.html @@ -0,0 +1,9 @@ +
+
+
+ + +
+ + + diff --git a/web/instructions.html b/web/instructions.html index 68f4cff7..1b2e0041 100644 --- a/web/instructions.html +++ b/web/instructions.html @@ -1,7 +1,3 @@ - -samba.org build farm - -

Adding a machine to the build farm

@@ -11,7 +7,7 @@ If you have a machine that you wish to add to our build farm then please follow
    -
  • Decide if your machine is suitable for the task: +
  • Decide if your machine is suitable for the task:
    • Is it a production machine?
    • Is it security-sensitive?
    • @@ -32,13 +28,13 @@ If you have a machine that you wish to add to our build farm then please follow
    • Make sure your machine is able to open an outgoing TCP connection to build.samba.org on port 873 (the rsync port). Test this by running

      -    rsync build.samba.org::
      +    rsync build.samba.org::
         
      and seeing if you get back the list of rsync modules.

      Note: there has been reports that rsync will work via http proxy. A simple

      -     export RSYNC_PROXY=cache:3128
      +     export RSYNC_PROXY=cache:3128
         
      before running rsync should be all that is needed.

    • @@ -76,10 +72,10 @@ If you have a machine that you wish to add to our build farm then please follow
    • Setup a cron job to run build_test regularly. You may wish to use "nice" to reduce its priority, for example I use the following cron - entry: -
      -    0,30 * * * * /bin/nice /home/build/build_farm/build_test 2> /home/build/cron.err
      -  
      + entry:
      + + 0,30 * * * * /bin/nice /home/build/build_farm/build_test 2> /home/build/cron.err +
    • Check that build.samba.org is showing your new host and that it is being updated regularly.
    • @@ -94,4 +90,3 @@ If you have a machine that you wish to add to our build farm then please follow

      Thanks!

      - diff --git a/web/samba-web b/web/samba-web new file mode 160000 index 00000000..e6f668a9 --- /dev/null +++ b/web/samba-web @@ -0,0 +1 @@ +Subproject commit e6f668a93d8e0fcacc9f1232562277de32f81c16