[79961] users/jmr/master.cfg

jmr at macports.org jmr at macports.org
Thu Jun 30 16:08:04 PDT 2011


Revision: 79961
          http://trac.macports.org/changeset/79961
Author:   jmr at macports.org
Date:     2011-06-30 16:08:03 -0700 (Thu, 30 Jun 2011)
Log Message:
-----------
update buildbot cfg

Modified Paths:
--------------
    users/jmr/master.cfg

Modified: users/jmr/master.cfg
===================================================================
--- users/jmr/master.cfg	2011-06-30 22:42:46 UTC (rev 79960)
+++ users/jmr/master.cfg	2011-06-30 23:08:03 UTC (rev 79961)
@@ -8,13 +8,22 @@
 # a shorter alias to save typing.
 c = BuildmasterConfig = {}
 
+# Master variable to toggle config between testing on your personal system
+# (where /opt/local shouldn't be messed with) and the production server (where
+# it has to be)
+production = False
+
 ####### BUILDSLAVES
 
 # The 'slaves' list defines the set of recognized buildslaves. Each element is
 # a BuildSlave object, specifying a unique slave name and password.  The same
 # slave name and password must be configured on the slave.
 from buildbot.buildslave import BuildSlave
-c['slaves'] = [BuildSlave("snowleopard-x86_64", "pass")]
+if production:
+    # FIXME
+    c['slaves'] = []
+else:
+    c['slaves'] = [BuildSlave("snowleopard-x86_64", "pass")]
 
 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
 # This must match the value configured into the buildslaves (with their
@@ -29,22 +38,24 @@
 # poller is used for local testing but PBChangeSource (which relies on
 # notifications from a post-commit script) should be used in production
 
-from buildbot.changes.svnpoller import SVNPoller
-c['change_source'] = [SVNPoller(
-        'https://svn.macports.org/repository/macports/trunk/base',
-        project='base',
-        svnbin='/opt/local/bin/svn',
-        pollinterval=300),
-    SVNPoller(
-        'https://svn.macports.org/repository/macports/trunk/dports',
-        project='ports',
-        svnbin='/opt/local/bin/svn',
-        pollinterval=300)
-    ]
+if production:
+    from buildbot.changes.pb import PBChangeSource
+    # FIXME: real username and password
+    c['change_source'] = PBChangeSource(user='change', passwd='changepw')
+else:
+    from buildbot.changes.svnpoller import SVNPoller
+    c['change_source'] = [SVNPoller(
+            'https://svn.macports.org/repository/macports/trunk/base',
+            project='base',
+            svnbin='/opt/local/bin/svn',
+            pollinterval=300),
+        SVNPoller(
+            'https://svn.macports.org/repository/macports/trunk/dports',
+            project='ports',
+            svnbin='/opt/local/bin/svn',
+            pollinterval=300)
+        ]
 
-# from buildbot.changes.pb import PBChangeSource
-# c['change_source'] = PBChangeSource(user='change', passwd='changepw')
-
 ####### SCHEDULERS
 
 # consider changes to _resources as unimportant
@@ -107,39 +118,60 @@
             portlist = ' '.join(portset)
             self.setProperty('portlist', portlist)
 
+
+# can't run with PREFIX/SRC_PREFIX inside the workdir in production,
+# because archives must be built with prefix=/opt/local
+if production:
+    prefix='/opt/local'
+    src_prefix='/opt/mports'
+    # FIXME
+    dlhost='mparchives.local'
+    dlpath='/archives'
+else:
+    prefix='%(workdir)s/opt/local'
+    src_prefix='%(workdir)s/opt/mports'
+    dlhost=''
+    dlpath='.'
+
 ports_factory = BuildFactory()
 # get MPAB itself; we'll do the checkout of base and dports via MPAB's script
 ports_factory.addStep(SVN(svnurl='https://svn.macports.org/repository/macports/contrib/mpab',
                       mode="update"))
-# XXX can't run with PREFIX/SRC_PREFIX inside the workdir in production,
-# because archives must be built with prefix=/opt/local
 ports_factory.addStep(ShellCommand(command=["./mpsync.sh"],
-                      env={'PREFIX': WithProperties("%(workdir)s/opt/local"),
-                           'SRC_PREFIX': WithProperties("%(workdir)s/opt/mports")}))
+                      env={'PREFIX': WithProperties(prefix),
+                           'SRC_PREFIX': WithProperties(src_prefix)}))
 ports_factory.addStep(ShellCommandWithPortList(command=WithProperties('echo %(portlist)s | tr " " "\n" > portlist')))
 # run MPAB on the port list
 ports_factory.addStep(Compile(command=["./mpab", "buildports", "portlist"],
-                      env={'PREFIX': WithProperties("%(workdir)s/opt/local"),
-                           'SRC_PREFIX': WithProperties("%(workdir)s/opt/mports")}))
+                      env={'PREFIX': WithProperties(prefix),
+                           'SRC_PREFIX': WithProperties(src_prefix)}))
 # sign generated binaries and sync to download server (if distributable)
-ports_factory.addStep(ShellCommand(command=["./deploy_archives.sh"]))
+ports_factory.addStep(ShellCommand(command=["./deploy_archives.sh"],
+                      env={'PREFIX': WithProperties(prefix),
+                           'DLHOST': dlhost,
+                           'DLPATH': dlpath}))
 
 # make a logfile summarising the success/failure status for each port
 ports_factory.addStep(ShellCommand(command=["./do_status.sh"],
+                        env={'PREFIX': WithProperties(prefix)},
                         logfiles={"portstatus": "portstatus.log"}))
 # do we want to upload the individual logs so maintainers can review them?
 ports_factory.addStep(ShellCommand(command="rm -rf ./logs-*"))
 
 from buildbot.config import BuilderConfig
 
-c['builders']= [
-    BuilderConfig(name="buildbase",
-      slavenames=["snowleopard-x86_64"],
-      factory=base_factory),
-    BuilderConfig(name="buildports",
-      slavenames=["snowleopard-x86_64"],
-      factory=ports_factory)
-    ]
+if production:
+    # FIXME
+    c['builders']= []
+else:
+    c['builders']= [
+        BuilderConfig(name="buildbase",
+          slavenames=["snowleopard-x86_64"],
+          factory=base_factory),
+        BuilderConfig(name="buildports",
+          slavenames=["snowleopard-x86_64"],
+          factory=ports_factory)
+        ]
 
 ####### STATUS TARGETS
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110630/43d58fe7/attachment-0001.html>


More information about the macports-changes mailing list