blob: 9194cfdd568baf83369d3e7df6cc024b876a6d85 [file] [log] [blame]
Mike Frysinger07284aa2023-08-22 02:09:07 -04001# Copyright 2020 The ChromiumOS Authors
Allen Li4f211142020-02-21 17:31:10 -08002# 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 Ikuta5588a072021-05-27 15:08:07 +090013readonly CIPD_PROTOC_VERSION='3.17.1'
Sean McAllister4551ffe2021-07-28 08:06:11 -060014readonly CIPD_BUF_VERSION='0.46.0'
Allen Li4f211142020-02-21 17:31:10 -080015
Sean Abraham17db9e82021-02-03 14:05:53 -070016GOBIN="${script_dir}/.go_bin"
Allen Li4f211142020-02-21 17:31:10 -080017readonly cipd_root="${script_dir}/.cipd_bin"
18cipd ensure \
19 -log-level warning \
20 -root "${cipd_root}" \
21 -ensure-file - \
22 <<ENSURE_FILE
Sean McAllister91734cf2021-05-20 15:52:47 -060023fuchsia/third_party/jq/\${platform} latest
Takuto Ikuta5588a072021-05-27 15:08:07 +090024infra/3pp/tools/protoc/\${platform} version:2@${CIPD_PROTOC_VERSION}
Allen Li4f211142020-02-21 17:31:10 -080025infra/3pp/tools/go/\${platform} latest
Sean McAllister4551ffe2021-07-28 08:06:11 -060026infra/3pp/go/github.com/bufbuild/buf/\${platform} version:2@${CIPD_BUF_VERSION}
Jack Neusce9818f2021-08-26 20:12:56 +000027infra/3pp/go/github.com/protocolbuffers/protoc-gen-go/\${platform} protoc
28infra/3pp/go/github.com/grpc/protoc-gen-go-grpc/\${platform} protoc
Allen Li4f211142020-02-21 17:31:10 -080029ENSURE_FILE
Sean McAllister91734cf2021-05-20 15:52:47 -060030
Sean Abraham17db9e82021-02-03 14:05:53 -070031PATH="${GOBIN}:${PATH}"
Sean McAllister91734cf2021-05-20 15:52:47 -060032PATH="${cipd_root}/bin:${PATH}"
33PATH="${cipd_root}:${PATH}"