jhbuild r2218 - trunk/buildbot



Author: fpeters
Date: Wed Aug 13 16:24:33 2008
New Revision: 2218
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2218&view=rev

Log:
* README, buildbot.tac, master.cfg: get slaves list from a slaves.csv
file; don't abort if builddir directory already exists.



Modified:
   trunk/buildbot/.svnignore
   trunk/buildbot/ChangeLog
   trunk/buildbot/README
   trunk/buildbot/buildbot.tac
   trunk/buildbot/master.cfg

Modified: trunk/buildbot/.svnignore
==============================================================================
--- trunk/buildbot/.svnignore	(original)
+++ trunk/buildbot/.svnignore	Wed Aug 13 16:24:33 2008
@@ -2,3 +2,4 @@
 changes.pck
 twistd.log*
 twistd.pid
+slaves.csv

Modified: trunk/buildbot/README
==============================================================================
--- trunk/buildbot/README	(original)
+++ trunk/buildbot/README	Wed Aug 13 16:24:33 2008
@@ -1,3 +1,5 @@
 You must at minimum edit those two lines in master.cfg:
  c['jhbuild'] = "~/bin/jhbuild"
  c['jhbuildrc'] = "/home/fred/.jhbuildrc"
+
+You must also define slaves in the slaves.csv file.

Modified: trunk/buildbot/buildbot.tac
==============================================================================
--- trunk/buildbot/buildbot.tac	(original)
+++ trunk/buildbot/buildbot.tac	Wed Aug 13 16:24:33 2008
@@ -3,7 +3,8 @@
 import os
 
 basedir = os.path.dirname(os.path.abspath(__file__))
-os.makedirs(os.path.join(basedir, 'builddir'))
+if not os.path.exists(os.path.join(basedir, 'builddir')):
+    os.makedirs(os.path.join(basedir, 'builddir'))
 configfile = r'master.cfg'
 
 application = service.Application('buildmaster')

Modified: trunk/buildbot/master.cfg
==============================================================================
--- trunk/buildbot/master.cfg	(original)
+++ trunk/buildbot/master.cfg	Wed Aug 13 16:24:33 2008
@@ -9,6 +9,8 @@
 # dictionary has a variety of keys to control different aspects of the
 # buildmaster. They are documented in docs/config.xhtml .
 
+import sys
+import os
 
 # This is the dictionary that the buildmaster pays attention to. We also use
 # a shorter alias to save typing.
@@ -23,13 +25,21 @@
 
 ####### BUILDSLAVES
 
-# the 'slaves' list defines the set of allowable buildslaves. Each element is
-# a tuple of bot-name and bot-password. These correspond to values given to
-# the buildslave's mktap invocation.
+# the 'slaves' list is read from the 'slaves.csv' file in the current directory
+# it is a CSV file structured like this:
+#  slavename,password
 from buildbot.buildslave import BuildSlave
-c['slaves'] = [
-        BuildSlave('slavename', 'password')
-]
+import csv
+
+if not os.path.exists('slaves'):
+    c['slaves'] = []
+else:
+    c['slaves'] = [BuildSlave(x[0], x[1])
+                   for x in csv.reader(file('slaves.csv'))
+                   if x and x[0] != '#']
+
+if len(c['slaves']) == 0:
+    print >> sys.stderr, 'You must fill slaves.csv with slaves'
 
 # to limit to two concurrent builds on a slave, use
 #  c['slaves'] = [BuildSlave("bot1name", "bot1passwd", max_builds=2)]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]