~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to schedule_hetero_control.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
    )
14
14
from utility import (
15
15
    find_candidates,
 
16
    get_auth_token,
16
17
    get_candidates_path,
17
18
    )
18
19
 
51
52
    candidates_path = get_candidates_path(root)
52
53
    for candidate_path in find_candidates(root, schedule_all):
53
54
        parent, candidate = os.path.split(candidate_path)
54
 
        if candidate.startswith('1.26'):
55
 
            # 1.26 was renamed to 2.0 because it is not compatible with 1.x
56
 
            continue
57
55
        if parent != candidates_path:
58
56
            raise ValueError('Wrong path')
59
57
        candidate_version, revision_build = get_candidate_info(candidate_path)
60
58
        for release in releases:
61
 
            # Releases with the same major number must be compatible.
62
 
            if release[:2] != candidate[:2]:
63
 
                continue
64
 
            for client_os in ('ubuntu', 'osx', 'windows'):
 
59
            for client_os in ('ubuntu',  'osx', 'windows'):
65
60
                yield {
66
61
                    'old_version': release,  # Client
67
62
                    'candidate': candidate_version,  # Server
81
76
 
82
77
 
83
78
def build_jobs(credentials, root, jobs):
84
 
    jenkins = Jenkins('http://juju-ci.vapour.ws:8080', *credentials)
 
79
    jenkins = Jenkins('http://localhost:8080', *credentials)
 
80
    token = get_auth_token(root, 'compatibility-control')
85
81
    os_str = {"ubuntu": "", "osx": "-osx", "windows": "-windows"}
86
82
    for job in jobs:
87
83
        jenkins.build_job(
88
 
            'compatibility-control{}'.format(os_str[job['client_os']]), job)
 
84
            'compatibility-control{}'.format(os_str[job['client_os']]), job,
 
85
            token=token)
89
86
 
90
87
 
91
88
def main():