| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """buildbucket module implements buildbucket-buildbot integration. | 5 """buildbucket module implements buildbucket-buildbot integration. |
| 6 | 6 |
| 7 The main entry point is buildbucket.setup() that accepts master configuration | 7 The main entry point is buildbucket.setup() that accepts master configuration |
| 8 dict with other buildbucket parameters and configures master to run builds | 8 dict with other buildbucket parameters and configures master to run builds |
| 9 scheduled on buildbucket service. | 9 scheduled on buildbucket service. |
| 10 | 10 |
| 11 Example: | 11 Example: |
| 12 buildbucket.setup( | 12 buildbucket.setup( |
| 13 c, # Configuration object. | 13 c, # Configuration object. |
| 14 ActiveMaster, | 14 ActiveMaster, |
| 15 buckets=['qo'], | 15 buckets=['qo'], |
| 16 ) | 16 ) |
| 17 | 17 |
| 18 """ | 18 """ |
| 19 | 19 |
| 20 import functools | 20 import functools |
| 21 import os | 21 import os |
| 22 | 22 |
| 23 from .common import Error | 23 from .common import Error |
| 24 from .integration import BuildBucketIntegrator | 24 from .integration import BuildBucketIntegrator |
| 25 from .poller import BuildBucketPoller | 25 from .poller import BuildBucketPoller |
| 26 from .status import BuildBucketStatus | 26 from .status import BuildBucketStatus |
| 27 from . import client | 27 from . import client |
| 28 from . import trigger |
| 28 | 29 |
| 29 | 30 |
| 30 def setup( | 31 def setup( |
| 31 config, active_master, buckets, poll_interval=10, | 32 config, active_master, buckets, poll_interval=10, |
| 32 buildbucket_hostname=None, max_lease_count=None, verbose=None, | 33 buildbucket_hostname=None, max_lease_count=None, verbose=None, |
| 33 dry_run=None): | 34 dry_run=None): |
| 34 """Configures a master to lease, schedule and update builds on buildbucket. | 35 """Configures a master to lease, schedule and update builds on buildbucket. |
| 35 | 36 |
| 36 Requires config to have 'mergeRequests' set to False. | 37 Requires config to have 'mergeRequests' set to False. |
| 37 | 38 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 poller = BuildBucketPoller( | 71 poller = BuildBucketPoller( |
| 71 integrator=integrator, | 72 integrator=integrator, |
| 72 poll_interval=poll_interval, | 73 poll_interval=poll_interval, |
| 73 dry_run=dry_run) | 74 dry_run=dry_run) |
| 74 status = BuildBucketStatus( | 75 status = BuildBucketStatus( |
| 75 integrator, | 76 integrator, |
| 76 buildbucket_service_factory=buildbucket_service_factory, | 77 buildbucket_service_factory=buildbucket_service_factory, |
| 77 dry_run=dry_run) | 78 dry_run=dry_run) |
| 78 config.setdefault('change_source', []).append(poller) | 79 config.setdefault('change_source', []).append(poller) |
| 79 config.setdefault('status', []).append(status) | 80 config.setdefault('status', []).append(status) |
| OLD | NEW |