skia2/infra/bots/assets/go_deps/create.py
Eric Boren 8d5da42a20 [infra] Also run install_go_deps.sh during go_deps asset creation
Bug: skia:
Change-Id: I41b3a0a4eea61e095bfda8affc17db0a0a7a91c5
Reviewed-on: https://skia-review.googlesource.com/c/159144
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2018-10-03 13:27:35 +00:00

47 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import os
import subprocess
def create_asset(target_dir):
"""Create the asset."""
env = {}
env.update(os.environ)
env['GOPATH'] = target_dir
subprocess.check_call(
['go', 'get', '-u', '-t', 'go.skia.org/infra/...'],
env=env)
# There's a broken symlink which causes a lot of problems. Delete it.
bad_symlink = os.path.join(
target_dir, 'src', 'go.chromium.org', 'luci', 'machine-db', 'appengine',
'frontend', 'bower_components')
os.remove(bad_symlink)
# Install additional dependencies via the install_go_deps.sh script.
script = os.path.join(
target_dir, 'src', 'go.skia.org', 'infra', 'scripts',
'install_go_deps.sh')
subprocess.check_call(script, env=env)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--target_dir', '-t', required=True)
args = parser.parse_args()
create_asset(args.target_dir)
if __name__ == '__main__':
main()