changeset 20:30ec24255ce9

stub out having a slave template too
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 Jan 2011 16:30:44 -0800
parents 6abe5fb1fafc
children 6c3c6488e4a9
files autobot/template.py setup.py
diffstat 2 files changed, 27 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/template.py	Fri Jan 07 14:05:46 2011 -0800
+++ b/autobot/template.py	Fri Jan 07 16:30:44 2011 -0800
@@ -22,8 +22,8 @@
     templates = [os.path.join('template', 'master')]
     vars = [Variable('slave', 'buildslave name', 'slave'),
             Variable('passwd', 'buildslave password', default='passwd'),
-            Variable('slaveport', 'port to talk to slaves on', default=9010),
-            Variable('htmlport', 'port for waterfall display', default=8010)]
+            Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int),
+            Variable('htmlport', 'port for waterfall display', default=8010, cast=int)]
 
     def pre(self, variables):
         factory = variables.get('factory')
@@ -54,12 +54,32 @@
     name = 'autobot-slave'
     description = 'template for the autotools buildbot slave'
     templates = [os.path.join('template', 'slave')]
-    look = True
+    vars = [Variable('master', 'host of the master', default='localhost'),
+            Variable('slave', 'buildslave name', 'slave'),
+            Variable('passwd', 'buildslave password', default='passwd'),
+            Variable('slaveport', 'port to talk to slaves on', default=9010)]
 
-def main(args=sys.argv[1:]):
+    def post(self, variables):
+        command = ['buildslave', 'create-slave', self.output,
+                   'localhost:%d' % variables['slaveport'],
+                   variables['slave'],
+                   variables['passwd'] ]
+
+# CLI front end functions
+# (console_script entry points)
+
+def create_master(args=sys.argv[1:]):
     cli = MakeItSoCLI(AutobotMasterTemplate)
     template = cli.parse()
     template.substitute()
 
+def create_slave(args=sys.argv[1:]):
+    cli = MakeItSoCLI(AutobotSlaveTemplate)
+    template = cli.parse()
+    template.substitute()
+
+def create_autobot(args=sys.argv[1:]):
+    raise NotImpmenetedError
+
 if __name__ == '__main__':
-    main()
+    create_master()
--- a/setup.py	Fri Jan 07 14:05:46 2011 -0800
+++ b/setup.py	Fri Jan 07 16:30:44 2011 -0800
@@ -26,6 +26,7 @@
       entry_points="""
       # -*- Entry points: -*-
       [console_scripts]
-      create-autobot-master = autobot.template:main
+      create-autobot-master = autobot.template:create_master
+      create-autobot-slave = autobot.template:create_slave
       """,
       )