Mercurial > hg > autobot
annotate autobot/projects/autobot/__init__.py @ 293:7bca6b5ecd90
STUB: autobot/projects/autobot/__init__.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 15 Apr 2014 22:28:10 -0700 |
parents | 5cd95c967f70 |
children |
rev | line source |
---|---|
71
a1568668175c
make the autobot project possibly do something
Jeff Hammel <jhammel@mozilla.com>
parents:
33
diff
changeset
|
1 from autobot.process.factory import PythonSourceFactory |
74
d94fbaac7c2c
stub out being able to find scripts cross-platform in a virtualenv
Jeff Hammel <jhammel@mozilla.com>
parents:
71
diff
changeset
|
2 from buildbot.steps.shell import ShellCommand |
d94fbaac7c2c
stub out being able to find scripts cross-platform in a virtualenv
Jeff Hammel <jhammel@mozilla.com>
parents:
71
diff
changeset
|
3 from buildbot.steps.shell import WithProperties |
33
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 |
71
a1568668175c
make the autobot project possibly do something
Jeff Hammel <jhammel@mozilla.com>
parents:
33
diff
changeset
|
5 class TestAutobotFactory(PythonSourceFactory): |
33
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 """ |
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 factory to test autobot |
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 """ |
134
a67fb62c04a6
start adding sources to the master.mfg
Jeff Hammel <jhammel@mozilla.com>
parents:
131
diff
changeset
|
9 |
293
7bca6b5ecd90
STUB: autobot/projects/autobot/__init__.py
Jeff Hammel <k0scist@gmail.com>
parents:
262
diff
changeset
|
10 sources = {'hg': ['http://k0s.org/hg/autobot']} |
134
a67fb62c04a6
start adding sources to the master.mfg
Jeff Hammel <jhammel@mozilla.com>
parents:
131
diff
changeset
|
11 |
262
5cd95c967f70
add publichtmlport to autobot project
Jeff Hammel <jhammel@mozilla.com>
parents:
260
diff
changeset
|
12 def __init__(self, platform=None, slaveport=7357, htmlport=7358, publichtmlport=7359, hg=None): |
33
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 |
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
14 # setup the environment |
234 | 15 PythonSourceFactory.__init__(self, platform=platform, name='autobot', hg=hg) |
33
cbeca1aea406
stub out autobot testing itself
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
16 |
92 | 17 # find the necessary scripts |
77
7493ba72cce7
* use absolute paths for finding (works in unix bash)
Jeff Hammel <jhammel@mozilla.com>
parents:
74
diff
changeset
|
18 self.findScript('create-autobot') |
92 | 19 self.findScript('buildbot') |
20 self.findScript('buildslave') | |
21 | |
22 # make sure the template creator actually does something | |
23 self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'), | |
24 '--list-factories'], | |
25 description='create-autobot --list-factories')) | |
26 | |
27 # make a master, slave pair | |
28 self.addStep(ShellCommand(command=[WithProperties('%(create-autobot)s'), | |
29 '-f', '-', # all factories, | |
260
d08050b4c858
i really dont want any channels please
Jeff Hammel <jhammel@mozilla.com>
parents:
259
diff
changeset
|
30 '--ircChannels', '', # no channels |
129
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
31 '--slaveport', str(slaveport), |
131
a14d466c843b
fix syntax error and note import errors in projects
Jeff Hammel <jhammel@mozilla.com>
parents:
129
diff
changeset
|
32 '--htmlport', str(htmlport), |
262
5cd95c967f70
add publichtmlport to autobot project
Jeff Hammel <jhammel@mozilla.com>
parents:
260
diff
changeset
|
33 '--publichtmlport', str(publichtmlport), |
95 | 34 'bot'], |
92 | 35 description="make an autobot", |
129
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
36 workdir=WithProperties('%(virtualenv)s'), |
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
37 haltOnFailure=True)) |
92 | 38 |
39 | |
40 # make sure they start | |
41 self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'), | |
42 'start', 'master'], | |
43 workdir=WithProperties('%(virtualenv)s/bot'), | |
44 description='start build master')) | |
45 self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'), | |
46 'start', 'slave'], | |
47 workdir=WithProperties('%(virtualenv)s/bot'), | |
48 description='start build slave')) | |
259
aa36f82313f1
really use no channels, damn system calls
Jeff Hammel <jhammel@mozilla.com>
parents:
258
diff
changeset
|
49 |
92 | 50 |
51 # try to access the waterfall | |
129
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
52 self.addStep(ShellCommand(command=['curl', |
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
53 'http://localhost:%s/' % htmlport])) |
92 | 54 |
129
a622d6b4db4a
use non-default ports for testing
Jeff Hammel <jhammel@mozilla.com>
parents:
95
diff
changeset
|
55 # could try to actually build, but we won't here |
92 | 56 |
57 # stop them! | |
58 self.addStep(ShellCommand(command=[WithProperties('%(buildbot)s'), | |
59 'stop', 'master'], | |
60 workdir=WithProperties('%(virtualenv)s/bot'), | |
61 description='stop build master')) | |
62 self.addStep(ShellCommand(command=[WithProperties('%(buildslave)s'), | |
63 'stop', 'slave'], | |
64 workdir=WithProperties('%(virtualenv)s/bot'), | |
65 description='stop build slave')) |