1# run from repository root
2
3
4
5# Example:
6#   make build
7#   make clean
8#   make docker-clean
9#   make docker-start
10#   make docker-kill
11#   make docker-remove
12
13.PHONY: build
14build:
15	GO_BUILD_FLAGS="-v" ./build
16	./bin/etcd --version
17	./bin/etcdctl version
18
19clean:
20	rm -f ./codecov
21	rm -rf ./agent-*
22	rm -rf ./covdir
23	rm -f ./*.coverprofile
24	rm -f ./*.log
25	rm -f ./bin/Dockerfile-release
26	rm -rf ./bin/*.etcd
27	rm -rf ./default.etcd
28	rm -rf ./tests/e2e/default.etcd
29	rm -rf ./gopath
30	rm -rf ./gopath.proto
31	rm -rf ./release
32	rm -f ./snapshot/localhost:*
33	rm -f ./tools/etcd-dump-metrics/localhost:*
34	rm -f ./integration/127.0.0.1:* ./integration/localhost:*
35	rm -f ./clientv3/integration/127.0.0.1:* ./clientv3/integration/localhost:*
36	rm -f ./clientv3/ordering/127.0.0.1:* ./clientv3/ordering/localhost:*
37
38docker-clean:
39	docker images
40	docker image prune --force
41
42docker-start:
43	service docker restart
44
45docker-kill:
46	docker kill `docker ps -q` || true
47
48docker-remove:
49	docker rm --force `docker ps -a -q` || true
50	docker rmi --force `docker images -q` || true
51
52
53
54GO_VERSION ?= 1.12.12
55ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")
56
57TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
58TEST_OPTS ?= PASSES='unit'
59
60TMP_DIR_MOUNT_FLAG = --mount type=tmpfs,destination=/tmp
61ifdef HOST_TMP_DIR
62	TMP_DIR_MOUNT_FLAG = --mount type=bind,source=$(HOST_TMP_DIR),destination=/tmp
63endif
64
65
66
67# Example:
68#   GO_VERSION=1.12.12 make build-docker-test
69#   make build-docker-test
70#
71#   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
72#   GO_VERSION=1.12.12 make push-docker-test
73#   make push-docker-test
74#
75#   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
76#   make pull-docker-test
77
78build-docker-test:
79	$(info GO_VERSION: $(GO_VERSION))
80	@sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/Dockerfile
81	docker build \
82	  --tag gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
83	  --file ./tests/Dockerfile .
84	@mv ./tests/Dockerfile.bak ./tests/Dockerfile
85
86push-docker-test:
87	$(info GO_VERSION: $(GO_VERSION))
88	gcloud docker -- push gcr.io/etcd-development/etcd-test:go$(GO_VERSION)
89
90pull-docker-test:
91	$(info GO_VERSION: $(GO_VERSION))
92	docker pull gcr.io/etcd-development/etcd-test:go$(GO_VERSION)
93
94
95
96# Example:
97#   make build-docker-test
98#   make compile-with-docker-test
99#   make compile-setup-gopath-with-docker-test
100
101compile-with-docker-test:
102	$(info GO_VERSION: $(GO_VERSION))
103	docker run \
104	  --rm \
105	  --mount type=bind,source=`pwd`,destination=/go/src/go.etcd.io/etcd \
106	  gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
107	  /bin/bash -c "GO_BUILD_FLAGS=-v GOOS=linux GOARCH=amd64 ./build && ./bin/etcd --version"
108
109compile-setup-gopath-with-docker-test:
110	$(info GO_VERSION: $(GO_VERSION))
111	docker run \
112	  --rm \
113	  --mount type=bind,source=`pwd`,destination=/etcd \
114	  gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
115	  /bin/bash -c "cd /etcd && ETCD_SETUP_GOPATH=1 GO_BUILD_FLAGS=-v GOOS=linux GOARCH=amd64 ./build && ./bin/etcd --version && rm -rf ./gopath"
116
117
118
119# Example:
120#
121# Local machine:
122#   TEST_OPTS="PASSES='fmt'" make test
123#   TEST_OPTS="PASSES='fmt bom dep build unit'" make test
124#   TEST_OPTS="PASSES='build unit release integration_e2e functional'" make test
125#   TEST_OPTS="PASSES='build grpcproxy'" make test
126#
127# Example (test with docker):
128#   make pull-docker-test
129#   TEST_OPTS="PASSES='fmt'" make docker-test
130#   TEST_OPTS="VERBOSE=2 PASSES='unit'" make docker-test
131#
132# Travis CI (test with docker):
133#   TEST_OPTS="PASSES='fmt bom dep build unit'" make docker-test
134#
135# Semaphore CI (test with docker):
136#   TEST_OPTS="PASSES='build unit release integration_e2e functional'" make docker-test
137#   HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build unit release integration_e2e functional'" make docker-test
138#   TEST_OPTS="GOARCH=386 PASSES='build unit integration_e2e'" make docker-test
139#
140# grpc-proxy tests (test with docker):
141#   TEST_OPTS="PASSES='build grpcproxy'" make docker-test
142#   HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build grpcproxy'" make docker-test
143
144.PHONY: test
145test:
146	$(info TEST_OPTS: $(TEST_OPTS))
147	$(info log-file: test-$(TEST_SUFFIX).log)
148	$(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log
149	! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
150
151docker-test:
152	$(info GO_VERSION: $(GO_VERSION))
153	$(info ETCD_VERSION: $(ETCD_VERSION))
154	$(info TEST_OPTS: $(TEST_OPTS))
155	$(info log-file: test-$(TEST_SUFFIX).log)
156	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
157	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
158	docker run \
159	  --rm \
160	  $(TMP_DIR_MOUNT_FLAG) \
161	  --mount type=bind,source=`pwd`,destination=/go/src/go.etcd.io/etcd \
162	  gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
163	  /bin/bash -c "$(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log"
164	! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
165
166docker-test-coverage:
167	$(info GO_VERSION: $(GO_VERSION))
168	$(info ETCD_VERSION: $(ETCD_VERSION))
169	$(info log-file: docker-test-coverage-$(TEST_SUFFIX).log)
170	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
171	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
172	docker run \
173	  --rm \
174	  $(TMP_DIR_MOUNT_FLAG) \
175	  --mount type=bind,source=`pwd`,destination=/go/src/go.etcd.io/etcd \
176	  gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
177	  /bin/bash -c "COVERDIR=covdir PASSES='build build_cov cov' ./test 2>&1 | tee docker-test-coverage-$(TEST_SUFFIX).log && /codecov -t 6040de41-c073-4d6f-bbf8-d89256ef31e1"
178	! egrep "(--- FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 docker-test-coverage-$(TEST_SUFFIX).log
179
180
181
182# Example:
183#   make compile-with-docker-test
184#   ETCD_VERSION=v3-test make build-docker-release-master
185#   ETCD_VERSION=v3-test make push-docker-release-master
186#   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
187
188build-docker-release-master:
189	$(info ETCD_VERSION: $(ETCD_VERSION))
190	cp ./Dockerfile-release ./bin/Dockerfile-release
191	docker build \
192	  --tag gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
193	  --file ./bin/Dockerfile-release \
194	  ./bin
195	rm -f ./bin/Dockerfile-release
196
197	docker run \
198	  --rm \
199	  gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
200	  /bin/sh -c "/usr/local/bin/etcd --version && /usr/local/bin/etcdctl version"
201
202push-docker-release-master:
203	$(info ETCD_VERSION: $(ETCD_VERSION))
204	gcloud docker -- push gcr.io/etcd-development/etcd:$(ETCD_VERSION)
205
206
207
208# Example:
209#   make build-docker-test
210#   make compile-with-docker-test
211#   make build-docker-static-ip-test
212#
213#   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
214#   make push-docker-static-ip-test
215#
216#   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
217#   make pull-docker-static-ip-test
218#
219#   make docker-static-ip-test-certs-run
220#   make docker-static-ip-test-certs-metrics-proxy-run
221
222build-docker-static-ip-test:
223	$(info GO_VERSION: $(GO_VERSION))
224	@sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-static-ip/Dockerfile
225	docker build \
226	  --tag gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
227	  --file ./tests/docker-static-ip/Dockerfile \
228	  ./tests/docker-static-ip
229	@mv ./tests/docker-static-ip/Dockerfile.bak ./tests/docker-static-ip/Dockerfile
230
231push-docker-static-ip-test:
232	$(info GO_VERSION: $(GO_VERSION))
233	gcloud docker -- push gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
234
235pull-docker-static-ip-test:
236	$(info GO_VERSION: $(GO_VERSION))
237	docker pull gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
238
239docker-static-ip-test-certs-run:
240	$(info GO_VERSION: $(GO_VERSION))
241	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
242	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
243	docker run \
244	  --rm \
245	  --tty \
246	  $(TMP_DIR_MOUNT_FLAG) \
247	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
248	  --mount type=bind,source=`pwd`/tests/docker-static-ip/certs,destination=/certs \
249	  gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
250	  /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
251
252docker-static-ip-test-certs-metrics-proxy-run:
253	$(info GO_VERSION: $(GO_VERSION))
254	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
255	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
256	docker run \
257	  --rm \
258	  --tty \
259	  $(TMP_DIR_MOUNT_FLAG) \
260	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
261	  --mount type=bind,source=`pwd`/tests/docker-static-ip/certs-metrics-proxy,destination=/certs-metrics-proxy \
262	  gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
263	  /bin/bash -c "cd /etcd && /certs-metrics-proxy/run.sh && rm -rf m*.etcd"
264
265
266
267# Example:
268#   make build-docker-test
269#   make compile-with-docker-test
270#   make build-docker-dns-test
271#
272#   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
273#   make push-docker-dns-test
274#
275#   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
276#   make pull-docker-dns-test
277#
278#   make docker-dns-test-insecure-run
279#   make docker-dns-test-certs-run
280#   make docker-dns-test-certs-gateway-run
281#   make docker-dns-test-certs-wildcard-run
282#   make docker-dns-test-certs-common-name-auth-run
283#   make docker-dns-test-certs-common-name-multi-run
284
285build-docker-dns-test:
286	$(info GO_VERSION: $(GO_VERSION))
287	@sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns/Dockerfile
288	docker build \
289	  --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
290	  --file ./tests/docker-dns/Dockerfile \
291	  ./tests/docker-dns
292	@mv ./tests/docker-dns/Dockerfile.bak ./tests/docker-dns/Dockerfile
293
294	docker run \
295	  --rm \
296	  --dns 127.0.0.1 \
297	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
298	  /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local"
299
300push-docker-dns-test:
301	$(info GO_VERSION: $(GO_VERSION))
302	gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
303
304pull-docker-dns-test:
305	$(info GO_VERSION: $(GO_VERSION))
306	docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
307
308docker-dns-test-insecure-run:
309	$(info GO_VERSION: $(GO_VERSION))
310	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
311	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
312	docker run \
313	  --rm \
314	  --tty \
315	  --dns 127.0.0.1 \
316	  $(TMP_DIR_MOUNT_FLAG) \
317	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
318	  --mount type=bind,source=`pwd`/tests/docker-dns/insecure,destination=/insecure \
319	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
320	  /bin/bash -c "cd /etcd && /insecure/run.sh && rm -rf m*.etcd"
321
322docker-dns-test-certs-run:
323	$(info GO_VERSION: $(GO_VERSION))
324	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
325	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
326	docker run \
327	  --rm \
328	  --tty \
329	  --dns 127.0.0.1 \
330	  $(TMP_DIR_MOUNT_FLAG) \
331	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
332	  --mount type=bind,source=`pwd`/tests/docker-dns/certs,destination=/certs \
333	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
334	  /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
335
336docker-dns-test-certs-gateway-run:
337	$(info GO_VERSION: $(GO_VERSION))
338	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
339	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
340	docker run \
341	  --rm \
342	  --tty \
343	  --dns 127.0.0.1 \
344	  $(TMP_DIR_MOUNT_FLAG) \
345	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
346	  --mount type=bind,source=`pwd`/tests/docker-dns/certs-gateway,destination=/certs-gateway \
347	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
348	  /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
349
350docker-dns-test-certs-wildcard-run:
351	$(info GO_VERSION: $(GO_VERSION))
352	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
353	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
354	docker run \
355	  --rm \
356	  --tty \
357	  --dns 127.0.0.1 \
358	  $(TMP_DIR_MOUNT_FLAG) \
359	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
360	  --mount type=bind,source=`pwd`/tests/docker-dns/certs-wildcard,destination=/certs-wildcard \
361	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
362	  /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
363
364docker-dns-test-certs-common-name-auth-run:
365	$(info GO_VERSION: $(GO_VERSION))
366	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
367	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
368	docker run \
369	  --rm \
370	  --tty \
371	  --dns 127.0.0.1 \
372	  $(TMP_DIR_MOUNT_FLAG) \
373	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
374	  --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-auth,destination=/certs-common-name-auth \
375	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
376	  /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd"
377
378docker-dns-test-certs-common-name-multi-run:
379	$(info GO_VERSION: $(GO_VERSION))
380	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
381	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
382	docker run \
383	  --rm \
384	  --tty \
385	  --dns 127.0.0.1 \
386	  $(TMP_DIR_MOUNT_FLAG) \
387	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
388	  --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-multi,destination=/certs-common-name-multi \
389	  gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
390	  /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd"
391
392
393
394# Example:
395#   make build-docker-test
396#   make compile-with-docker-test
397#   make build-docker-dns-srv-test
398#   gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
399#   make push-docker-dns-srv-test
400#   gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
401#   make pull-docker-dns-srv-test
402#   make docker-dns-srv-test-certs-run
403#   make docker-dns-srv-test-certs-gateway-run
404#   make docker-dns-srv-test-certs-wildcard-run
405
406build-docker-dns-srv-test:
407	$(info GO_VERSION: $(GO_VERSION))
408	@sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns-srv/Dockerfile
409	docker build \
410	  --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
411	  --file ./tests/docker-dns-srv/Dockerfile \
412	  ./tests/docker-dns-srv
413	@mv ./tests/docker-dns-srv/Dockerfile.bak ./tests/docker-dns-srv/Dockerfile
414
415	docker run \
416	  --rm \
417	  --dns 127.0.0.1 \
418	  gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
419	  /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig +noall +answer SRV _etcd-client-ssl._tcp.etcd.local && dig +noall +answer SRV _etcd-server-ssl._tcp.etcd.local && dig +noall +answer m1.etcd.local m2.etcd.local m3.etcd.local"
420
421push-docker-dns-srv-test:
422	$(info GO_VERSION: $(GO_VERSION))
423	gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
424
425pull-docker-dns-srv-test:
426	$(info GO_VERSION: $(GO_VERSION))
427	docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
428
429docker-dns-srv-test-certs-run:
430	$(info GO_VERSION: $(GO_VERSION))
431	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
432	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
433	docker run \
434	  --rm \
435	  --tty \
436	  --dns 127.0.0.1 \
437	  $(TMP_DIR_MOUNT_FLAG) \
438	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
439	  --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs,destination=/certs \
440	  gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
441	  /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
442
443docker-dns-srv-test-certs-gateway-run:
444	$(info GO_VERSION: $(GO_VERSION))
445	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
446	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
447	docker run \
448	  --rm \
449	  --tty \
450	  --dns 127.0.0.1 \
451	  $(TMP_DIR_MOUNT_FLAG) \
452	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
453	  --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs-gateway,destination=/certs-gateway \
454	  gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
455	  /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
456
457docker-dns-srv-test-certs-wildcard-run:
458	$(info GO_VERSION: $(GO_VERSION))
459	$(info HOST_TMP_DIR: $(HOST_TMP_DIR))
460	$(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
461	docker run \
462	  --rm \
463	  --tty \
464	  --dns 127.0.0.1 \
465	  $(TMP_DIR_MOUNT_FLAG) \
466	  --mount type=bind,source=`pwd`/bin,destination=/etcd \
467	  --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs-wildcard,destination=/certs-wildcard \
468	  gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
469	  /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
470
471
472
473# Example:
474#   make build-functional
475#   make build-docker-functional
476#   make push-docker-functional
477#   make pull-docker-functional
478
479build-functional:
480	$(info GO_VERSION: $(GO_VERSION))
481	$(info ETCD_VERSION: $(ETCD_VERSION))
482	./functional/build
483	./bin/etcd-agent -help || true && \
484	  ./bin/etcd-proxy -help || true && \
485	  ./bin/etcd-runner --help || true && \
486	  ./bin/etcd-tester -help || true
487
488build-docker-functional:
489	$(info GO_VERSION: $(GO_VERSION))
490	$(info ETCD_VERSION: $(ETCD_VERSION))
491	@sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./functional/Dockerfile
492	docker build \
493	  --tag gcr.io/etcd-development/etcd-functional:go$(GO_VERSION) \
494	  --file ./functional/Dockerfile \
495	  .
496	@mv ./functional/Dockerfile.bak ./functional/Dockerfile
497
498	docker run \
499	  --rm \
500	  gcr.io/etcd-development/etcd-functional:go$(GO_VERSION) \
501	  /bin/bash -c "./bin/etcd --version && \
502	   ./bin/etcd-failpoints --version && \
503	   ./bin/etcdctl version && \
504	   ./bin/etcd-agent -help || true && \
505	   ./bin/etcd-proxy -help || true && \
506	   ./bin/etcd-runner --help || true && \
507	   ./bin/etcd-tester -help || true && \
508	   ./bin/benchmark --help || true"
509
510push-docker-functional:
511	$(info GO_VERSION: $(GO_VERSION))
512	$(info ETCD_VERSION: $(ETCD_VERSION))
513	gcloud docker -- push gcr.io/etcd-development/etcd-functional:go$(GO_VERSION)
514
515pull-docker-functional:
516	$(info GO_VERSION: $(GO_VERSION))
517	$(info ETCD_VERSION: $(ETCD_VERSION))
518	docker pull gcr.io/etcd-development/etcd-functional:go$(GO_VERSION)
519