1cb93a386Sopenharmony_ci#!/usr/bin/env python
2cb93a386Sopenharmony_ci#
3cb93a386Sopenharmony_ci# Copyright 2018 Google LLC
4cb93a386Sopenharmony_ci#
5cb93a386Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
6cb93a386Sopenharmony_ci# found in the LICENSE file.
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_cifrom __future__ import print_function
10cb93a386Sopenharmony_ciimport os
11cb93a386Sopenharmony_ciimport subprocess
12cb93a386Sopenharmony_ciimport sys
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_ci
15cb93a386Sopenharmony_cikitchen = os.path.join(os.getcwd(), 'kitchen')
16cb93a386Sopenharmony_cilogdog_url = 'logdog://logs.chromium.org/%s/%s/+/annotations' % (
17cb93a386Sopenharmony_ci    sys.argv[4], os.environ['SWARMING_TASK_ID'])
18cb93a386Sopenharmony_ci
19cb93a386Sopenharmony_cicmd = [
20cb93a386Sopenharmony_ci  kitchen, 'cook',
21cb93a386Sopenharmony_ci    '-checkout-dir', 'recipe_bundle',
22cb93a386Sopenharmony_ci    '-mode', 'swarming',
23cb93a386Sopenharmony_ci    '-luci-system-account', 'system',
24cb93a386Sopenharmony_ci    '-cache-dir', 'cache',
25cb93a386Sopenharmony_ci    '-temp-dir', 'tmp',
26cb93a386Sopenharmony_ci    '-known-gerrit-host', 'android.googlesource.com',
27cb93a386Sopenharmony_ci    '-known-gerrit-host', 'boringssl.googlesource.com',
28cb93a386Sopenharmony_ci    '-known-gerrit-host', 'chromium.googlesource.com',
29cb93a386Sopenharmony_ci    '-known-gerrit-host', 'dart.googlesource.com',
30cb93a386Sopenharmony_ci    '-known-gerrit-host', 'fuchsia.googlesource.com',
31cb93a386Sopenharmony_ci    '-known-gerrit-host', 'go.googlesource.com',
32cb93a386Sopenharmony_ci    '-known-gerrit-host', 'llvm.googlesource.com',
33cb93a386Sopenharmony_ci    '-known-gerrit-host', 'skia.googlesource.com',
34cb93a386Sopenharmony_ci    '-known-gerrit-host', 'webrtc.googlesource.com',
35cb93a386Sopenharmony_ci    '-recipe', sys.argv[2],
36cb93a386Sopenharmony_ci    '-properties', sys.argv[3],
37cb93a386Sopenharmony_ci    '-logdog-annotation-url', logdog_url,
38cb93a386Sopenharmony_ci]
39cb93a386Sopenharmony_ciprint('running command: %s' % ' '.join(cmd))
40cb93a386Sopenharmony_cisubprocess.check_call(cmd)
41