aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Eric Boren <borenet@google.com>2017-10-17 09:18:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-17 13:43:42 +0000
commitcff9f956c794954a67000792ab632c17026ececf (patch)
tree21840cc97c227cd482899517ea5cb8cb4757f0b6 /infra
parent7bbbf62d6ec14aea43e7dff7933bf9fb98575dca (diff)
bin/try: Add support for select Chromium trybots
These are hard-coded in update_meta_config.py, which is used to set the list of trybots in Gerrit. Bug: skia: Change-Id: I6e512e4cb59974e27e8954cf5134c70068e716f3 Reviewed-on: https://skia-review.googlesource.com/60521 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/update_meta_config.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/infra/bots/update_meta_config.py b/infra/bots/update_meta_config.py
index 3a10d5222d..12ac26f792 100644
--- a/infra/bots/update_meta_config.py
+++ b/infra/bots/update_meta_config.py
@@ -63,8 +63,14 @@ def addChromiumTrybots(f):
f.write('\tbuilder = %s\n' % bot)
-def main(gitcookies, repo_name, tasks_json):
- skia_repo = SKIA_REPO_TEMPLATE % repo_name
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--gitcookies")
+ parser.add_argument("--repo_name")
+ parser.add_argument("--tasks_json")
+ args = parser.parse_args()
+
+ skia_repo = SKIA_REPO_TEMPLATE % args.repo_name
with git_utils.NewGitCheckout(repository=skia_repo):
# Fetch and checkout the meta/config branch.
subprocess.check_call(['git', 'fetch', skia_repo, 'refs/meta/config:cfg'])
@@ -72,7 +78,7 @@ def main(gitcookies, repo_name, tasks_json):
# Create list of tryjobs from tasks_json.
tryjobs = []
- with open(tasks_json) as tasks_json:
+ with open(args.tasks_json) as tasks_json:
data = json.load(tasks_json)
for job in data['jobs'].keys():
if not job.startswith('Upload-'):
@@ -83,7 +89,7 @@ def main(gitcookies, repo_name, tasks_json):
buildbucket_config = os.path.join(os.getcwd(), 'buildbucket.config')
with open(buildbucket_config, 'w') as f:
- if repo_name == 'skia':
+ if args.repo_name == 'skia':
addChromiumTrybots(f)
# Adding all Skia jobs.
@@ -95,7 +101,7 @@ def main(gitcookies, repo_name, tasks_json):
config_dict = {
'user.name': SKIA_COMMITTER_NAME,
'user.email': SKIA_COMMITTER_EMAIL,
- 'http.cookiefile': gitcookies,
+ 'http.cookiefile': args.gitcookies,
}
with git_utils.GitLocalConfig(config_dict):
subprocess.check_call(['git', 'add', 'buildbucket.config'])
@@ -110,9 +116,4 @@ def main(gitcookies, repo_name, tasks_json):
if '__main__' == __name__:
- parser = argparse.ArgumentParser()
- parser.add_argument("--gitcookies")
- parser.add_argument("--repo_name")
- parser.add_argument("--tasks_json")
- args = parser.parse_args()
- main(args.gitcookies, args.repo_name, args.tasks_json)
+ main()