-
Notifications
You must be signed in to change notification settings - Fork 210
/
cloudbuild.yaml
96 lines (96 loc) · 4.22 KB
/
cloudbuild.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# See https://cloud.google.com/cloud-build/docs/build-config
# For more information about Image pushing refer to https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md
timeout: 3600s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'golang:1.22.4'
env:
- IMAGE_REPO=${_IMAGE_REPO}
- IMAGE_TAG=${_PULL_BASE_REF}
entrypoint: tools/push-images
# build gke-gcloud-auth-plugin binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-linux-amd64
- build
- //cmd/gke-gcloud-auth-plugin
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-linux-amd64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/gke-gcloud-auth-plugin/gke-gcloud-auth-plugin_/gke-gcloud-auth-plugin
- gs://k8s-staging-cloud-provider-gcp/gke-gcloud-auth-plugin/linux-amd64/${_GIT_TAG}
# build auth-provider-gcp binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-linux-amd64
- build
- //cmd/auth-provider-gcp
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-linux-amd64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/auth-provider-gcp/auth-provider-gcp_/auth-provider-gcp
- gs://k8s-staging-cloud-provider-gcp/auth-provider-gcp/linux-amd64/${_GIT_TAG}
# build gke-gcloud-auth-plugin binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-linux-arm64
- build
- --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64
- //cmd/gke-gcloud-auth-plugin
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-linux-arm64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/gke-gcloud-auth-plugin/gke-gcloud-auth-plugin_/gke-gcloud-auth-plugin
- gs://k8s-staging-cloud-provider-gcp/gke-gcloud-auth-plugin/linux-arm64/${_GIT_TAG}
# build auth-provider-gcp binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-linux-arm64
- build
- --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64
- //cmd/auth-provider-gcp
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-linux-arm64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/auth-provider-gcp/auth-provider-gcp_/auth-provider-gcp
- gs://k8s-staging-cloud-provider-gcp/auth-provider-gcp/linux-arm64/${_GIT_TAG}
# build gke-gcloud-auth-plugin binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-windows-amd64
- build
- --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64
- //cmd/gke-gcloud-auth-plugin
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-windows-amd64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/gke-gcloud-auth-plugin/gke-gcloud-auth-plugin_/gke-gcloud-auth-plugin.exe
- gs://k8s-staging-cloud-provider-gcp/gke-gcloud-auth-plugin/windows-amd64/${_GIT_TAG}
# build auth-provider-gcp binary
- name: 'gcr.io/cloud-builders/bazel'
args:
- --output_user_root=/workspace/bazel-root
- --output_base=/workspace/bazel-base-windows-amd64
- build
- --platforms=@io_bazel_rules_go//go/toolchain:windows_amd64
- //cmd/auth-provider-gcp
- name: 'gcr.io/cloud-builders/gsutil'
args:
- cp
- /workspace/bazel-base-windows-amd64/execroot/io_k8s_cloud_provider_gcp/bazel-out/k8-fastbuild/bin/cmd/auth-provider-gcp/auth-provider-gcp_/auth-provider-gcp.exe
- gs://k8s-staging-cloud-provider-gcp/auth-provider-gcp/windows-amd64/${_GIT_TAG}
# TODO: figure out how to do this better, most probably getting rid of bazel
substitutions:
_PULL_BASE_REF: 'master'
_GIT_TAG: '12345'
_IMAGE_REPO: 'gcr.io/k8s-staging-cloud-provider-gcp'
tags:
- 'cloud-provider-gcp'
- ${_GIT_TAG}
- ${_PULL_BASE_REF}