OLD | NEW |
| (Empty) |
1 # -*- python -*- | |
2 # ex: set syntax=python: | |
3 | |
4 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
5 # Use of this source code is governed by a BSD-style license that can be | |
6 # found in the LICENSE file. | |
7 | |
8 # Chrome Buildbot slave configuration | |
9 | |
10 import os | |
11 import sys | |
12 | |
13 from twisted.application import service | |
14 # python module paths changed from buildbot-7 to buildbot-8; support both | |
15 try: | |
16 from buildbot.slave.bot import BuildSlave | |
17 except ImportError: | |
18 from buildslave.bot import BuildSlave | |
19 | |
20 # Register the commands. | |
21 from slave import chromium_commands | |
22 from slave import slave_utils | |
23 # Load default settings. | |
24 import config | |
25 | |
26 | |
27 # Determines the slave type: | |
28 ActiveMaster = config.Master.ChromiumFYI | |
29 | |
30 | |
31 # Slave properties: | |
32 slavename = None | |
33 password = config.Master.GetBotPassword() | |
34 host = None | |
35 port = None | |
36 basedir = None | |
37 keepalive = 600 | |
38 usepty = 1 | |
39 umask = None | |
40 | |
41 | |
42 if slavename is None: | |
43 # Automatically determine the host name. | |
44 import socket | |
45 slavename = socket.getfqdn().split('.')[0].lower() | |
46 | |
47 if password is None: | |
48 msg = '*** No password configured in %s.\n' % repr(__file__) | |
49 sys.stderr.write(msg) | |
50 sys.exit(1) | |
51 | |
52 if ActiveMaster is None: | |
53 ActiveMaster = slave_utils.GetActiveMasterConfig() | |
54 | |
55 if host is None: | |
56 host = ActiveMaster.master_host | |
57 | |
58 if port is None: | |
59 port = ActiveMaster.slave_port | |
60 | |
61 if basedir is None: | |
62 dir, _file = os.path.split(__file__) | |
63 basedir = os.path.abspath(dir) | |
64 | |
65 | |
66 application = service.Application('buildslave') | |
67 s = BuildSlave(host, port, slavename, password, basedir, keepalive, usepty, | |
68 umask=umask) | |
69 s.setServiceParent(application) | |
OLD | NEW |