/
build-twill
50 lines (38 loc) · 1.39 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
46
47
48
49
50
#! /usr/bin/env python
import sys
from pony_build_client import BuildCommand, TestCommand, do, send, \
TempDirectoryContext, SetupCommand, SvnUpdate, check, parse_cmdline
options, args = parse_cmdline()
if args:
print 'ignoring command line args: ', args
repo_url = 'https://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 = 'http://localhost:8080/xmlrpc'
server_url = 'http://lyorn.idyll.org/ctb/pb-dev/xmlrpc'
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 = [ SvnUpdate('twill', repo_url, name='checkout', cache_dir='~/.pony-build/twill'),
BuildCommand([python_exe, 'setup.py', 'build'],
name='compile'),
TestCommand([python_exe, 'setup.py', 'test'], name='run tests'),
]
context = TempDirectoryContext(False)
results = do(name, commands, context=context)
client_info, reslist = results
if options.report:
print 'result: %s; sending' % (client_info['success'],)
send(server_url, results, tags=tags)
else:
print 'build result:'
import pprint
pprint.pprint(client_info)
pprint.pprint(reslist)
print '(NOT SENDING BUILD RESULT TO SERVER)'
if not client_info['success']:
sys.exit(-1)