Mercurial > hg > autobot
comparison autobot/template.py @ 294:45fd58949f8a
STUB: autobot/projects/__init__.py autobot/template.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 11 May 2014 04:30:57 -0700 |
parents | 754cda797873 |
children | 773192c7c5b3 |
comparison
equal
deleted
inserted
replaced
293:7bca6b5ecd90 | 294:45fd58949f8a |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 """ | 3 """ |
4 makeitso templates for the A*Team's buildbot | 4 MakeItSo templates for autobot |
5 | |
6 see http://k0s.org/hg/MakeItSo | |
5 """ | 7 """ |
6 | 8 |
7 import mozinfo | |
8 import os | 9 import os |
9 import string | 10 import string |
10 import sys | 11 import sys |
11 from makeitso.cli import MakeItSoCLI | 12 from makeitso.cli import MakeItSoCLI |
12 from makeitso.template import assemble | 13 from makeitso.template import assemble |
30 return buffer.getvalue().strip() | 31 return buffer.getvalue().strip() |
31 | 32 |
32 | 33 |
33 class AutobotMasterTemplate(MakeItSoTemplate): | 34 class AutobotMasterTemplate(MakeItSoTemplate): |
34 name = 'autobot-master' | 35 name = 'autobot-master' |
35 description = 'template for the autotools buildbot master' | 36 description = 'template for the autobot buildbot master' |
36 templates = [os.path.join('template', 'master')] | 37 templates = [os.path.join('template', 'master')] |
37 vars = [Variable('slave', 'buildslave name', os_type or 'slave'), | 38 vars = [Variable('slave', 'buildslave name', os_type or 'slave'), |
38 Variable('os', 'buildslave os (win, mac, linux)', os_type), | 39 Variable('os', 'buildslave os (win, mac, linux)', os_type), |
39 Variable('passwd', 'buildslave password', default='passwd'), | 40 Variable('passwd', 'buildslave password', default='passwd'), |
40 Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int), | 41 Variable('slaveport', 'port to talk to slaves on', default=9010, cast=int), |
41 Variable('htmlport', 'port for waterfall display', default=8010, cast=int), | 42 Variable('htmlport', 'port for waterfall display', default=8010, cast=int), |
42 Variable('publichtmlport', 'port for public waterfall display', default=8011, cast=int), | 43 Variable('publichtmlport', 'port for public waterfall display', default=8011, cast=int), |
43 Variable('botname', 'name of IRC bot', default='autobot-test'), # use autobot in production | 44 Variable('botname', 'name of IRC bot'), |
44 Variable('ircHost', 'IRC host'), | 45 Variable('ircHost', 'IRC host'), |
45 Variable('ircChannels', 'channels for the IRC bot ("-" for none)', default='#ateam-test'), # use #ateam in production | 46 Variable('ircChannels', 'channels for the IRC bot ("-" for none)') |
46 Variable('domain', 'autobot domain name', default='localhost'), | 47 Variable('domain', 'autobot domain name', default='localhost'), |
47 Variable('recipients', 'email recipients for all projects', '') | 48 Variable('recipients', 'email recipients for all projects', '') |
48 ] | 49 ] |
49 | 50 |
50 def pre(self, variables, output): | 51 def pre(self, variables, output): |
163 def parse(self, args=None, parser=None, options=None): | 164 def parse(self, args=None, parser=None, options=None): |
164 | 165 |
165 # parse the arguments | 166 # parse the arguments |
166 parser = self.parser() | 167 parser = self.parser() |
167 options, args = parser.parse_args(args=args) | 168 options, args = parser.parse_args(args=args) |
168 | |
169 if not(args): | 169 if not(args): |
170 parser.print_usage() | 170 parser.print_usage() |
171 parser.exit() | 171 parser.exit() |
172 | 172 |
173 # deploy to the correct place | 173 # deploy to the correct place |