diff --git a/.circleci/config.yml b/.circleci/config.yml index 1e9cd51dfe1..003ce49ab86 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,12 +4,17 @@ orbs: aws-s3: circleci/aws-s3@2.0.0 terraform: circleci/terraform@2.1.0 +parameters: + cross-container-tag: + type: string + default: go1.18.5-81cd97477f9a6c9f2db03dc56f560bf54f8da8bb + executors: cross-builder: docker: # NOTE: To upgrade the Go version, first push the upgrade to the cross-builder Dockerfile # in the edge repo, then update the version here to match. - - image: quay.io/influxdb/cross-builder:go1.18.5-bc9c7f5b200055b18d50111c54d3aa59fc798d5f + - image: quay.io/influxdb/cross-builder:<< pipeline.parameters.cross-container-tag >> resource_class: large linux-amd64: machine: diff --git a/releng/protoc-gen b/releng/protoc-gen new file mode 100755 index 00000000000..712220403e9 --- /dev/null +++ b/releng/protoc-gen @@ -0,0 +1,49 @@ +#!/bin/bash +set -o errexit \ + -o nounset \ + -o pipefail + +ROOT="$(realpath "${BASH_SOURCE}")" # -> /releng/protoc-gen +ROOT="$(dirname "${ROOT}")" # -> /releng/ +ROOT="$(dirname "${ROOT}")" # -> / + +( + # Since this script is run outside of a docker container, it is + # possible that one (or more) of the following executables is + # not installed. + set -x + which docker + which sudo + which yq +) 1>/dev/null + +CROSS_BUILDER_VERSION="$(yq -e eval '.parameters.cross-container-tag.default' "${ROOT}/.circleci/config.yml")" + +# Updating ownership within the container requires both the "UID" and "GID" +# of the current user. Since the current user does not exist within the +# container, "${USER}:" cannot be supplied to `chown`. +USER_UID="$(id -u)" +USER_GID="$(id -g)" + +read -d '' DOCKERSCRIPT <