11steps :
2- - id : docker
2+ - id : docker_buildx
33 name : docker:20.10
44 args :
55 - build
@@ -11,7 +11,22 @@ steps:
1111 - hack/dockerfiles
1212 env :
1313 - " DOCKER_BUILDKIT=1"
14- waitFor : ["-"]
14+ waitFor :
15+ - " -"
16+
17+ - id : bootstrap_buildx
18+ name : docker-buildx:cloudbuild
19+ args :
20+ - buildx
21+ - create
22+ - --bootstrap
23+ - --name=cloudbuild
24+ - --driver=docker-container
25+ - --driver-opt=image=moby/buildkit:nightly
26+ - --driver-opt=network=cloudbuild
27+ - --use
28+ waitFor :
29+ - " docker_buildx"
1530
1631 - id : protoc-builder
1732 name : docker-buildx:cloudbuild
@@ -23,20 +38,23 @@ steps:
2338 - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
2439 - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
2540 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
41+ - --cache-from=type=registry,ref=gcr.io/$PROJECT_ID/protoc/protoc-builder:cloudbuild_cache
42+ - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc-builder:cloudbuild_cache,push=true
2643 - .
27- waitFor : ["docker"]
44+ waitFor :
45+ - " bootstrap_buildx"
2846
2947 - id : protoc
3048 name : docker-buildx:cloudbuild
3149 args :
3250 - buildx
3351 - build
3452 - --target=protoc
35- - --build-arg=BUILDKIT_INLINE_CACHE=1
3653 - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
3754 - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
3855 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
39- - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION},push=false
56+ - --tag="gcr.io/$PROJECT_ID/protoc/protoc:${_PR_NUMBER:-${_PROTOC_VERSION}}"
57+ - --load
4058 - .
4159 waitFor :
4260 - " protoc-builder"
@@ -47,11 +65,11 @@ steps:
4765 - buildx
4866 - build
4967 - --target=protoc-debug
50- - --build-arg=BUILDKIT_INLINE_CACHE=1
5168 - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
5269 - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
5370 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
54- - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug,push=false
71+ - --tag="gcr.io/$PROJECT_ID/protoc/protoc:${_PR_NUMBER:-${_PROTOC_VERSION}}-debug"
72+ - --load
5573 - .
5674 waitFor :
5775 - " protoc-builder"
6886 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
6987 - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
7088 - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
89+ - --cache-from=type=registry,ref=gcr.io/$PROJECT_ID/protoc/golang-builder:cloudbuild_cache
90+ - --output=type=image,name=gcr.io/$PROJECT_ID/protoc/golang-builder:cloudbuild_cache,push=true
7191 - .
7292 waitFor :
7393 - " protoc"
@@ -79,14 +99,13 @@ steps:
7999 - buildx
80100 - build
81101 - --target=golang
82- - --build-arg=BUILDKIT_INLINE_CACHE=1
83102 - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
84103 - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
85104 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
86105 - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
87106 - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
88- - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}
89- - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}
107+ - --tag=" gcr.io/$PROJECT_ID/protoc/golang:${_PR_NUMBER:-${ _PROTOC_VERSION}-${_GOLANG_VERSION}}"
108+ - --load
90109 - .
91110 waitFor :
92111 - " golang-builder"
@@ -97,14 +116,13 @@ steps:
97116 - buildx
98117 - build
99118 - --target=golang-debug
100- - --build-arg=BUILDKIT_INLINE_CACHE=1
101119 - --build-arg=PROTOC_VERSION=${_PROTOC_VERSION}
102120 - --build-arg=GOLANG_VERSION=${_GOLANG_VERSION}
103121 - --build-arg=ALPINE_VERSION=${_ALPINE_VERSION}
104122 - --build-arg=PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
105123 - --build-arg=PROTOC_GEN_GO_GRPC_VERSION=${_PROTOC_GEN_GO_GRPC_VERSION}
106- - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug
107- - --tag=gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug
124+ - --tag=" gcr.io/$PROJECT_ID/protoc/golang:${_PR_NUMBER:-${ _PROTOC_VERSION}-${_GOLANG_VERSION}} -debug"
125+ - --load
108126 - .
109127 waitFor :
110128 - " golang-builder"
@@ -118,13 +136,11 @@ substitutions:
118136 _PROTOC_GEN_GO_VERSION : " v1.27.1" # https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.27.1
119137 _PROTOC_GEN_GO_GRPC_VERSION : " 9c668aeab869" # https://github.com/grpc/grpc-go/tree/9c668aeab869
120138
121- images :
122- - " gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}"
123- - " gcr.io/$PROJECT_ID/protoc/protoc:${_PROTOC_VERSION}-debug"
124- - " gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}"
125- - " gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}"
126- - " gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-${_GOLANG_VERSION}-debug"
127- - " gcr.io/$PROJECT_ID/protoc/golang:${_PROTOC_VERSION}-debug"
139+ # images:
140+ # - "gcr.io/$PROJECT_ID/protoc/protoc:${_PR_NUMBER:-${_PROTOC_VERSION}}"
141+ # - "gcr.io/$PROJECT_ID/protoc/protoc:${_PR_NUMBER:-${_PROTOC_VERSION}}-debug"
142+ # - "gcr.io/$PROJECT_ID/protoc/golang:${_PR_NUMBER:-${_PROTOC_VERSION}-${_GOLANG_VERSION}}"
143+ # - "gcr.io/$PROJECT_ID/protoc/golang:${_PR_NUMBER:-${_PROTOC_VERSION}-${_GOLANG_VERSION}}-debug"
128144
129145tags :
130146 - " protoc.protoc"
0 commit comments