-
Notifications
You must be signed in to change notification settings - Fork 11
/
build-twill
45 lines (35 loc) · 1.17 KB
/
build-twill
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env python
import sys
import pprint
from pony_client import BuildCommand, TestCommand, do, send, \
TempDirectoryContext, SetupCommand, SvnCheckout, check, parse_cmdline
options, args = parse_cmdline()
if args:
print 'ignoring command line args: ', args
repo_url = 'http://twill.googlecode.com/svn/branches/0.9.2-dev/twill'
python_exe = 'python2.5'
if args:
python_exe = args[0]
name = 'twill'
tags = [python_exe]
server_url = options.server_url
if not options.force_build:
if not check(name, server_url, tags=tags):
print 'check build says no need to build; bye'
sys.exit(0)
commands = [ SvnCheckout('twill', repo_url, name='checkout'),
BuildCommand([python_exe, 'setup.py', 'test'])
]
context = TempDirectoryContext()
results = do(name, commands, context=context)
client_info, reslist, files = results
if options.report:
print 'result: %s; sending' % (client_info['success'],)
send(server_url, results, tags=tags)
else:
print 'build result:'
pprint.pprint(client_info)
pprint.pprint(reslist)
print '(NOT SENDING BUILD RESULT TO SERVER)'
if not client_info['success']:
sys.exit(-1)