forked from kubernetes/cloud-provider-gcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
134 lines (134 loc) · 6.02 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# 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.20.12'
env:
- IMAGE_REPO=${_IMAGE_REPO}
- IMAGE_TAG=${_PULL_BASE_REF}
entrypoint: tools/push-images
# build gke-exec-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-exec-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-exec-auth-plugin/gke-exec-auth-plugin_/gke-exec-auth-plugin
- gs://k8s-staging-cloud-provider-gcp/gke-exec-auth-plugin/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-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-exec-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-exec-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-exec-auth-plugin/gke-exec-auth-plugin_/gke-exec-auth-plugin
- gs://k8s-staging-cloud-provider-gcp/gke-exec-auth-plugin/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-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-exec-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-exec-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-exec-auth-plugin/gke-exec-auth-plugin_/gke-exec-auth-plugin.exe
- gs://k8s-staging-cloud-provider-gcp/gke-exec-auth-plugin/windows-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-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}