Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #366 from hakman/cloudbuild_bazel-v5.4.0
Browse files Browse the repository at this point in the history
Use official Bazel container image with Cloud Build
  • Loading branch information
k8s-ci-robot authored Feb 6, 2023
2 parents f6e8cdb + b3a9a90 commit e674167
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64"
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64"
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
Expand All @@ -49,7 +49,7 @@ jobs:

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64"
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
Expand All @@ -67,7 +67,7 @@ jobs:

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64"
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ container-build:
docker run --rm -e VERSION_OVERRIDE=${VERSION_OVERRIDE} -e GOPROXY -v $(PWD):$(PACKAGE_GOPATH) -w $(PACKAGE_GOPATH) $(GIT_STORAGE_MOUNT) ${GO_IMAGE} /bin/bash -c "make"

$(BIN):
GO111MODULE=on go build -ldflags "$(LDFLAGS)"
go build -buildvcs=false -ldflags "$(LDFLAGS)"

clean:
rm -f $(BIN) plantuml.jar
Expand Down
5 changes: 2 additions & 3 deletions dev/staging/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ options:
machineType: 'N1_HIGHCPU_8'

steps:
- name: gcr.io/k8s-testimages/krte:latest-master
- name: golang:1.19
env:
- PULL_BASE_REF=$_PULL_BASE_REF
- VERSION=$_GIT_TAG
- DOCKER_REGISTRY=$_DOCKER_REGISTRY
- DOCKER_IMAGE_PREFIX=$_DOCKER_IMAGE_PREFIX
- ARTIFACT_LOCATION=$_ARTIFACT_LOCATION
- INSTALL_BAZELISK=y
entrypoint: dev/staging/push-etcdadm.sh
- name: gcr.io/k8s-testimages/krte:latest-master
- name: golang:1.19
env:
- PULL_BASE_REF=$_PULL_BASE_REF
# We don't pass version; we want to use our own version tagging from git
Expand Down
2 changes: 1 addition & 1 deletion dev/staging/push-etcdmanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [[ "${ARTIFACT_LOCATION}" != */ ]]; then
fi

if [[ -n "${INSTALL_BAZELISK:-}" ]]; then
DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64"
DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64"
echo "Downloading bazelisk from $DOWNLOAD_URL"
curl -L --output "/tmp/bazelisk" "${DOWNLOAD_URL}"
chmod +x "/tmp/bazelisk"
Expand Down
14 changes: 7 additions & 7 deletions etcd-manager/cloudbuild-master.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
steps:
- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['version']

- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['build', '//cmd/...', '//images:etcd-manager', '//images:etcd-manager-slim', '//images:etcd-backup', '//images:etcd-dump']
# To build with GCS cache
#args: ['build', '--google_default_credentials', '--spawn_strategy=remote', '--genrule_strategy=remote', '--strategy=Javac=remote', '--strategy=Closure=remote', '--remote_http_cache=https://storage.googleapis.com/cache-bucket', '//cmd/...']

- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['test', '//test/...', '--test_output=streamed', '--local_test_jobs=1']

- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['run', '//images:push-etcd-manager']
env:
- 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}'
- 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}'
- 'DOCKER_TAG=${COMMIT_SHA}'
- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['run', '//images:push-etcd-manager-slim']
env:
- 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}'
- 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}'
- 'DOCKER_TAG=${COMMIT_SHA}'
- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['run', '//images:push-etcd-dump']
env:
- 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}'
- 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}'
- 'DOCKER_TAG=${COMMIT_SHA}'
- name: gcr.io/cloud-builders/bazel
- name: gcr.io/bazel-public/bazel:5.4.0
args: ['run', '//images:push-etcd-backup']
env:
- 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}'
Expand Down
6 changes: 3 additions & 3 deletions etcd-manager/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
steps:
- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0
- name: gcr.io/bazel-public/bazel:5.4.0
entrypoint: bazel
args: ['version']

- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0
- name: gcr.io/bazel-public/bazel:5.4.0
entrypoint: bazel
args: ['build', '//cmd/...', '//images:etcd-manager', '//images:etcd-manager-slim', '//images:etcd-backup', '//images:etcd-dump']
# To build with GCS cache
#args: ['build', '--google_default_credentials', '--spawn_strategy=remote', '--genrule_strategy=remote', '--strategy=Javac=remote', '--strategy=Closure=remote', '--remote_http_cache=https://storage.googleapis.com/cache-bucket', '//cmd/...']

- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0
- name: gcr.io/bazel-public/bazel:5.4.0
entrypoint: bazel
args: ['test', '//test/...', '--test_output=streamed', '--local_test_jobs=1']

Expand Down

0 comments on commit e674167

Please sign in to comment.