annotate autobot/template.py @ 12:848569b7f91a

use subdirectories for the master and slave
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 Jan 2011 11:49:53 -0800
parents fe1dc9e43d09
children 59cc21718ced
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
3
1d615610e442 add a docstring
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
4 templates for the A*Team's buildbot
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
12
848569b7f91a use subdirectories for the master and slave
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
7 import os
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 import sys
6
4ba6ba323871 stub out invocation of the template; this should eventually move to its own class, as we will want to subclass MakeItSoCLI, /me thinks
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
9 from makeitso.cli import MakeItSoCLI
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
10 from makeitso.template import MakeItSoTemplate
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
11 from makeitso.template import Variable
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 class AutobotMasterTemplate(MakeItSoTemplate):
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 name = 'autobot-master'
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
15 description = 'template for the autotools buildbot master'
12
848569b7f91a use subdirectories for the master and slave
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
16 templates = [os.path.join('template', 'master')]
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
17 vars = [Variable('slave', 'buildslave name', 'slave'),
5
b7c521f53bda document what the passwd variable is for
Jeff Hammel <jhammel@mozilla.com>
parents: 4
diff changeset
18 Variable('passwd', 'buildslave password', default='passwd'),
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
19 Variable('slaveport', 'port to talk to slaves on', default=9010),
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
20 Variable('htmlport', 'port for waterfall display', default=8010)]
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
21
9
c06441767a2a now interpolates correctly; just doesnt do much
Jeff Hammel <jhammel@mozilla.com>
parents: 8
diff changeset
22 def pre(self, variables):
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
23 variables['factory'] = 'foo'
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 class AutobotSlaveTemplate(MakeItSoTemplate):
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 name = 'autobot-slave'
4
eb289a46f4d3 make buildbot master template look close to what it should
Jeff Hammel <jhammel@mozilla.com>
parents: 3
diff changeset
27 description = 'template for the autotools buildbot slave'
12
848569b7f91a use subdirectories for the master and slave
Jeff Hammel <jhammel@mozilla.com>
parents: 11
diff changeset
28 templates = [os.path.join('template', 'slave')]
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 look = True
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 def main(args=sys.argv[1:]):
6
4ba6ba323871 stub out invocation of the template; this should eventually move to its own class, as we will want to subclass MakeItSoCLI, /me thinks
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
32 cli = MakeItSoCLI(AutobotMasterTemplate)
4ba6ba323871 stub out invocation of the template; this should eventually move to its own class, as we will want to subclass MakeItSoCLI, /me thinks
Jeff Hammel <jhammel@mozilla.com>
parents: 5
diff changeset
33 template = cli.parse()
8
6cba2df39955 time to substitute!
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
34 template.substitute()
1
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 if __name__ == '__main__':
3bd7f767d74a more stubbing of template
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 main()