changeset 17:baee795ad6df

stub out actually calling buildbot
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 Jan 2011 13:42:21 -0800
parents 9ad3a9e220bc
children 016ffd7bfd99
files autobot/template.py
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/template.py	Fri Jan 07 13:05:10 2011 -0800
+++ b/autobot/template.py	Fri Jan 07 13:42:21 2011 -0800
@@ -11,6 +11,11 @@
 from makeitso.template import Variable
 from projects import factories
 
+try:
+    from subprocess import check_call as call
+except ImportError:
+    from subprocess import call
+
 class AutobotMasterTemplate(MakeItSoTemplate):
     name = 'autobot-master'
     description = 'template for the autotools buildbot master'
@@ -37,6 +42,18 @@
         else:
             raise AssertionError("No factory provided")
 
+    def post(self, variables
+        """
+        called after the template is applied
+        """
+        #        import pdb; pdb.set_trace()
+        oldcwd = os.getcwd()
+        os.chdir()
+        command = ['buildbot', 'create-master', vars['master'] ]
+        print ' '.join(command)
+        call(command)
+        os.chdir(oldcwd)
+
 class AutobotSlaveTemplate(MakeItSoTemplate):
     name = 'autobot-slave'
     description = 'template for the autotools buildbot slave'