view autobot/template/template.py @ 8:6cba2df39955

time to substitute!
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 Jan 2011 17:57:50 -0800
parents 4ba6ba323871
children c06441767a2a
line wrap: on
line source

#!/usr/bin/env python

"""
templates for the A*Team's buildbot
"""

import sys
from makeitso.cli import MakeItSoCLI
from makeitso.template import MakeItSoTemplate
from makeitso.template import Variable

class AutobotMasterTemplate(MakeItSoTemplate):
    name = 'autobot-master'
    description = 'template for the autotools buildbot master'
    templates = ['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)]

    def pre(self, **variables):
        variables['factory'] = 'foo'

class AutobotSlaveTemplate(MakeItSoTemplate):
    name = 'autobot-slave'
    description = 'template for the autotools buildbot slave'
    templates = ['slave']
    look = True

def main(args=sys.argv[1:]):
    cli = MakeItSoCLI(AutobotMasterTemplate)
    template = cli.parse()
    template.substitute()

if __name__ == '__main__':
    main()