21
17
parser = ArgumentParser()
22
18
parser.add_argument(
23
19
'root_dir', help='Directory containing releases and candidates dir')
24
parser.add_argument('--suite', help='Test suite to run', default=[],
25
choices=suites.keys(), action='append')
20
parser.add_argument('--suite', help='Test suite to run', default=FULL,
21
choices=suites.keys())
26
22
parser.add_argument('jobs', nargs='*', metavar='job',
27
23
help='Jobs to schedule builds for.')
28
add_credential_args(parser)
29
24
result = parser.parse_args(argv)
30
25
if result.jobs == []:
32
credentials = get_credentials(result)
33
return result, credentials
36
def build_job(credentials, root, job_name, candidates, suite):
37
parameters = {'suite': ','.join(suite), 'attempts': '10'}
38
jenkins = Jenkins('http://juju-ci.vapour.ws:8080', credentials.user,
40
for candidate, revision_build in candidates:
42
'revision_build': '{:d}'.format(revision_build),
30
def build_job(root, job_name, candidates, suite):
31
parameters = {'suite': suite, 'attempts': '10'}
32
jenkins = Jenkins('http://localhost:8080')
33
for candidate in candidates:
34
call_parameters = {'new_juju_dir': candidate}
44
35
call_parameters.update(parameters)
45
jenkins.build_job(job_name, call_parameters)
49
args, credentials = parse_args(argv)
53
candidates = find_latest_branch_candidates(args.root_dir)[:3]
36
token = get_auth_token(root, job_name)
37
jenkins.build_job(job_name, call_parameters, token=token)
42
candidates = list(find_candidates(args.root_dir))
56
45
jobs = ['industrial-test', 'industrial-test-aws',
57
46
'industrial-test-joyent']
59
build_job(credentials, args.root_dir, job, candidates, suite)
48
build_job(args.root_dir, job, candidates, args.suite)
62
51
if __name__ == '__main__':