Mike Frysinger | 07284aa | 2023-08-22 02:09:07 -0400 | [diff] [blame] | 1 | # Copyright 2020 The ChromiumOS Authors |
Allen Li | 4f21114 | 2020-02-21 17:31:10 -0800 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | # |
| 5 | # Sets up cipd packages for presubmit scripts. |
| 6 | # |
| 7 | # Scripts should set the script_dir variable and source this file: |
| 8 | # |
| 9 | # readonly script_dir="$(dirname "$(realpath -e "${BASH_SOURCE[0]}")")" |
| 10 | # source "${script_dir}/setup_cipd.sh" |
| 11 | |
| 12 | # Versions of packages to get from CIPD. |
Takuto Ikuta | 5588a07 | 2021-05-27 15:08:07 +0900 | [diff] [blame] | 13 | readonly CIPD_PROTOC_VERSION='3.17.1' |
Sean McAllister | 4551ffe | 2021-07-28 08:06:11 -0600 | [diff] [blame] | 14 | readonly CIPD_BUF_VERSION='0.46.0' |
Allen Li | 4f21114 | 2020-02-21 17:31:10 -0800 | [diff] [blame] | 15 | |
Sean Abraham | 17db9e8 | 2021-02-03 14:05:53 -0700 | [diff] [blame] | 16 | GOBIN="${script_dir}/.go_bin" |
Allen Li | 4f21114 | 2020-02-21 17:31:10 -0800 | [diff] [blame] | 17 | readonly cipd_root="${script_dir}/.cipd_bin" |
| 18 | cipd ensure \ |
| 19 | -log-level warning \ |
| 20 | -root "${cipd_root}" \ |
| 21 | -ensure-file - \ |
| 22 | <<ENSURE_FILE |
Sean McAllister | 91734cf | 2021-05-20 15:52:47 -0600 | [diff] [blame] | 23 | fuchsia/third_party/jq/\${platform} latest |
Takuto Ikuta | 5588a07 | 2021-05-27 15:08:07 +0900 | [diff] [blame] | 24 | infra/3pp/tools/protoc/\${platform} version:2@${CIPD_PROTOC_VERSION} |
Allen Li | 4f21114 | 2020-02-21 17:31:10 -0800 | [diff] [blame] | 25 | infra/3pp/tools/go/\${platform} latest |
Sean McAllister | 4551ffe | 2021-07-28 08:06:11 -0600 | [diff] [blame] | 26 | infra/3pp/go/github.com/bufbuild/buf/\${platform} version:2@${CIPD_BUF_VERSION} |
Jack Neus | ce9818f | 2021-08-26 20:12:56 +0000 | [diff] [blame] | 27 | infra/3pp/go/github.com/protocolbuffers/protoc-gen-go/\${platform} protoc |
| 28 | infra/3pp/go/github.com/grpc/protoc-gen-go-grpc/\${platform} protoc |
Allen Li | 4f21114 | 2020-02-21 17:31:10 -0800 | [diff] [blame] | 29 | ENSURE_FILE |
Sean McAllister | 91734cf | 2021-05-20 15:52:47 -0600 | [diff] [blame] | 30 | |
Sean Abraham | 17db9e8 | 2021-02-03 14:05:53 -0700 | [diff] [blame] | 31 | PATH="${GOBIN}:${PATH}" |
Sean McAllister | 91734cf | 2021-05-20 15:52:47 -0600 | [diff] [blame] | 32 | PATH="${cipd_root}/bin:${PATH}" |
| 33 | PATH="${cipd_root}:${PATH}" |