-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
145 lines (135 loc) · 4.85 KB
/
cloudbuild.yaml
File metadata and controls
145 lines (135 loc) · 4.85 KB
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
135
136
137
138
139
140
141
142
143
144
145
steps:
- id: docker
name: docker:20.10
args:
- build
- --target=docker
- --build-arg=DOCKER_VERSION=${_DOCKER_VERSION}
- --build-arg=BUILDX_DIGEST=${_BUILDX_DIGEST}
- --tag=docker-buildx:cloudbuild
- --file=hack/dockerfiles/buildx.dockerfile
- hack/dockerfiles
env:
- "DOCKER_BUILDKIT=1"
waitFor: ["-"]
- id: protoc-builder
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=protoc-builder
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --allow=network.host
- --network=host
- .
waitFor: ["docker"]
- id: protoc
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=protoc
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION},push=false
- --allow=network.host
- --network=host
- .
waitFor:
- "protoc-builder"
- id: protoc-debug
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=protoc-debug
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug,push=false
- --allow=network.host
- --network=host
- .
waitFor:
- "protoc-builder"
- id: golang-builder
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=golang-builder
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
- --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
- --allow=network.host
- --network=host
- .
waitFor:
- "protoc"
- "protoc-debug"
- id: golang
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=golang
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
- --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
- --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}
- --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}
- --allow=network.host
- --network=host
- .
waitFor:
- "golang-builder"
- id: golang-debug
name: docker-buildx:cloudbuild
args:
- buildx
- build
- --target=golang-debug
- --build-arg=BUILDKIT_INLINE_CACHE=1
- --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
- --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
- --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
- --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
- --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug
- --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug
- --allow=network.host
- --network=host
- .
waitFor:
- "golang-builder"
substitutions:
_DOCKER_VERSION: "20.10"
_BUILDX_DIGEST: "2ec838c5f74e1cdd5e6ea4e789c0c0f5573807550b50b2ddc6deb2c2033a286b" # https://github.com/docker/buildx/tree/084b6c0a95ce, https://github.com/docker/buildx/runs/3947339794
_PROTOC_VERSION: "3.19.0" # https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.0
_GOLANG_VERSION: "1.17"
_ALPINE_VERSION: "3.14"
_PROTOC_GEN_GO_VERSION: "v1.27.1" # https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.27.1
_PROTOC_GEN_GO_GRPC_VERSION: "9c668aeab869" # https://github.com/grpc/grpc-go/tree/9c668aeab869
images:
- "gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}"
- "gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug"
- "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}"
- "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}"
- "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug"
- "gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug"
tags:
- "protoc.protoc"
- "protoc.golang"
timeout: 900s # 15min