OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 6 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
7 | 7 |
8 """A git-command for integrating reviews on Rietveld and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
9 | 9 |
10 from __future__ import print_function | 10 from __future__ import print_function |
(...skipping 4597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 | 4608 |
4609 print('The tree is %s' % status) | 4609 print('The tree is %s' % status) |
4610 print() | 4610 print() |
4611 print(GetTreeStatusReason()) | 4611 print(GetTreeStatusReason()) |
4612 if status != 'open': | 4612 if status != 'open': |
4613 return 1 | 4613 return 1 |
4614 return 0 | 4614 return 0 |
4615 | 4615 |
4616 | 4616 |
4617 def CMDtry(parser, args): | 4617 def CMDtry(parser, args): |
4618 '''Triggers try jobs through BuildBucket.''' | 4618 """Triggers try jobs using CQ dry run or BuildBucket for individual builders. |
| 4619 """ |
4619 group = optparse.OptionGroup(parser, 'Try job options') | 4620 group = optparse.OptionGroup(parser, 'Try job options') |
4620 group.add_option( | 4621 group.add_option( |
4621 '-b', '--bot', action='append', | 4622 '-b', '--bot', action='append', |
4622 help=('IMPORTANT: specify ONE builder per --bot flag. Use it multiple ' | 4623 help=('IMPORTANT: specify ONE builder per --bot flag. Use it multiple ' |
4623 'times to specify multiple builders. ex: ' | 4624 'times to specify multiple builders. ex: ' |
4624 '"-b win_rel -b win_layout". See ' | 4625 '"-b win_rel -b win_layout". See ' |
4625 'the try server waterfall for the builders name and the tests ' | 4626 'the try server waterfall for the builders name and the tests ' |
4626 'available.')) | 4627 'available.')) |
4627 group.add_option( | 4628 group.add_option( |
4628 '-m', '--master', default='', | 4629 '-m', '--master', default='', |
4629 help=('Specify a try master where to run the tries.')) | 4630 help=('Specify a try master where to run the tries.')) |
| 4631 # TODO(tandrii,nodir): add -B --bucket flag. |
4630 group.add_option( | 4632 group.add_option( |
4631 '-r', '--revision', | 4633 '-r', '--revision', |
4632 help='Revision to use for the try job; default: the ' | 4634 help='Revision to use for the try job; default: the revision will ' |
4633 'revision will be determined by the try server; see ' | 4635 'be determined by the try recipe that builder runs, which usually ' |
4634 'its waterfall for more info') | 4636 'defaults to HEAD of origin/master') |
4635 group.add_option( | 4637 group.add_option( |
4636 '-c', '--clobber', action='store_true', default=False, | 4638 '-c', '--clobber', action='store_true', default=False, |
4637 help='Force a clobber before building; e.g. don\'t do an ' | 4639 help='Force a clobber before building; that is don\'t do an ' |
4638 'incremental build') | 4640 'incremental build') |
4639 group.add_option( | 4641 group.add_option( |
4640 '--project', | 4642 '--project', |
4641 help='Override which project to use. Projects are defined ' | 4643 help='Override which project to use. Projects are defined ' |
4642 'server-side to define what default bot set to use') | 4644 'in recipe to determine to which repository or directory to ' |
| 4645 'apply the patch') |
4643 group.add_option( | 4646 group.add_option( |
4644 '-p', '--property', dest='properties', action='append', default=[], | 4647 '-p', '--property', dest='properties', action='append', default=[], |
4645 help='Specify generic properties in the form -p key1=value1 -p ' | 4648 help='Specify generic properties in the form -p key1=value1 -p ' |
4646 'key2=value2 etc (buildbucket only). The value will be treated as ' | 4649 'key2=value2 etc. The value will be treated as ' |
4647 'json if decodable, or as string otherwise.') | 4650 'json if decodable, or as string otherwise. ' |
| 4651 'NOTE: using this may make your try job not usable for CQ, ' |
| 4652 'which will then schedule another try job with default properties') |
| 4653 # TODO(tandrii): if this even used? |
4648 group.add_option( | 4654 group.add_option( |
4649 '-n', '--name', help='Try job name; default to current branch name') | 4655 '-n', '--name', help='Try job name; default to current branch name') |
| 4656 # TODO(tandrii): get rid of this. |
4650 group.add_option( | 4657 group.add_option( |
4651 '--use-rietveld', action='store_true', default=False, | 4658 '--use-rietveld', action='store_true', default=False, |
4652 help='Use Rietveld to trigger try jobs.') | 4659 help='Use Rietveld to trigger try jobs.') |
4653 group.add_option( | 4660 group.add_option( |
4654 '--buildbucket-host', default='cr-buildbucket.appspot.com', | 4661 '--buildbucket-host', default='cr-buildbucket.appspot.com', |
4655 help='Host of buildbucket. The default host is %default.') | 4662 help='Host of buildbucket. The default host is %default.') |
4656 parser.add_option_group(group) | 4663 parser.add_option_group(group) |
4657 auth.add_auth_options(parser) | 4664 auth.add_auth_options(parser) |
4658 options, args = parser.parse_args(args) | 4665 options, args = parser.parse_args(args) |
4659 auth_config = auth.extract_auth_config_from_options(options) | 4666 auth_config = auth.extract_auth_config_from_options(options) |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5310 if __name__ == '__main__': | 5317 if __name__ == '__main__': |
5311 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5318 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5312 # unit testing. | 5319 # unit testing. |
5313 fix_encoding.fix_encoding() | 5320 fix_encoding.fix_encoding() |
5314 setup_color.init() | 5321 setup_color.init() |
5315 try: | 5322 try: |
5316 sys.exit(main(sys.argv[1:])) | 5323 sys.exit(main(sys.argv[1:])) |
5317 except KeyboardInterrupt: | 5324 except KeyboardInterrupt: |
5318 sys.stderr.write('interrupted\n') | 5325 sys.stderr.write('interrupted\n') |
5319 sys.exit(1) | 5326 sys.exit(1) |
OLD | NEW |