Skip to content

Commit

Permalink
ci: install golang if not currently installed from ci tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Jun 6, 2024
1 parent 4f9204c commit 78dacb0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev/ci/postsubmits/release-kcc-cli
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ set -o pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd ${REPO_ROOT}

${REPO_ROOT}/dev/tasks/install-tools

${REPO_ROOT}/dev/tasks/generate-licenses
${REPO_ROOT}/dev/tasks/build-cli-bundle
32 changes: 32 additions & 0 deletions dev/tasks/install-tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT="$(git rev-parse --show-toplevel)"
cd "${REPO_ROOT}"

if [[ ! -x go ]]; then
echo "Must install go; assuming we are running in a container"
curl -L -o /tmp/go.tar.gz https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
sha256sum -c - <<EOF
ba79d4526102575196273416239cca418a651e049c2b099f3159db85e7bade7d /tmp/go.tar.gz
EOF
tar -C /usr/local -xzf /tmp/go.tar.gz
ln -sf /usr/local/go/bin/go /usr/bin/go
rm /tmp/go.tar.gz
fi

0 comments on commit 78dacb0

Please sign in to comment.