~canonical-launchpad-branches/launchpad-buildd/trunk

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
#!/usr/bin/env python
# Copyright 2010 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
#
# Test script for manual use only.  Exercises the
# TranslationTemplatesBuildManager through XMLRPC.

import sys

from xmlrpclib import ServerProxy

if len(sys.argv) != 2:
    print "Usage: %s <chroot_sha1>" % sys.argv[0]
    print "Where <chroot_sha1> is the SHA1 of the chroot tarball to use."
    print "The chroot tarball must be in the local Librarian."
    print "See https://dev.launchpad.net/Soyuz/HowToUseSoyuzLocally"
    sys.exit(1)

chroot_sha1 = sys.argv[1]

proxy = ServerProxy('http://localhost:8221/rpc')
print proxy.info()
print proxy.status()
buildid = '1-2'
build_type = 'translation-templates'
filemap = {}
args = {'branch_url': 'no-branch-here-sorry'}
print proxy.build(buildid, build_type, chroot_sha1, filemap, args)
#status = proxy.status()
#for filename, sha1 in status[3].iteritems():
#    print filename
#proxy.clean()