Makefile 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. # run from repository root
  2. # Example:
  3. # make clean -f ./hack/scripts-dev/Makefile
  4. # make build -f ./hack/scripts-dev/Makefile
  5. .PHONY: build
  6. build:
  7. GO_BUILD_FLAGS="-v" ./build
  8. ./bin/etcd --version
  9. ETCDCTL_API=3 ./bin/etcdctl version
  10. clean:
  11. rm -f ./codecov
  12. rm -rf ./agent-*
  13. rm -rf ./covdir
  14. rm -f ./*.log
  15. rm -f ./bin/Dockerfile-release
  16. rm -rf ./bin/*.etcd
  17. rm -rf ./gopath
  18. rm -rf ./release
  19. rm -f ./integration/127.0.0.1:* ./integration/localhost:*
  20. rm -f ./clientv3/integration/127.0.0.1:* ./clientv3/integration/localhost:*
  21. rm -f ./clientv3/ordering/127.0.0.1:* ./clientv3/ordering/localhost:*
  22. GO_VERSION ?= 1.10
  23. ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")
  24. TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
  25. TEST_OPTS ?= PASSES='unit'
  26. TMP_DIR_MOUNT_FLAG = --mount type=tmpfs,destination=/tmp
  27. ifdef HOST_TMP_DIR
  28. TMP_DIR_MOUNT_FLAG = --mount type=bind,source=$(HOST_TMP_DIR),destination=/tmp
  29. endif
  30. # Example:
  31. # GO_VERSION=1.8.7 make build-docker-test -f ./hack/scripts-dev/Makefile
  32. # make build-docker-test -f ./hack/scripts-dev/Makefile
  33. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  34. # GO_VERSION=1.8.7 make push-docker-test -f ./hack/scripts-dev/Makefile
  35. # make push-docker-test -f ./hack/scripts-dev/Makefile
  36. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  37. # GO_VERSION=1.8.7 make pull-docker-test -f ./hack/scripts-dev/Makefile
  38. # make pull-docker-test -f ./hack/scripts-dev/Makefile
  39. build-docker-test:
  40. $(info GO_VERSION: $(GO_VERSION))
  41. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./Dockerfile-test
  42. docker build \
  43. --tag gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  44. --file ./Dockerfile-test .
  45. @mv ./Dockerfile-test.bak ./Dockerfile-test
  46. push-docker-test:
  47. $(info GO_VERSION: $(GO_VERSION))
  48. gcloud docker -- push gcr.io/etcd-development/etcd-test:go$(GO_VERSION)
  49. pull-docker-test:
  50. $(info GO_VERSION: $(GO_VERSION))
  51. docker pull gcr.io/etcd-development/etcd-test:go$(GO_VERSION)
  52. # Example:
  53. # make build-docker-test -f ./hack/scripts-dev/Makefile
  54. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  55. # make compile-setup-gopath-with-docker-test -f ./hack/scripts-dev/Makefile
  56. compile-with-docker-test:
  57. $(info GO_VERSION: $(GO_VERSION))
  58. docker run \
  59. --rm \
  60. --mount type=bind,source=`pwd`,destination=/go/src/github.com/coreos/etcd \
  61. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  62. /bin/bash -c "GO_BUILD_FLAGS=-v ./build && ./bin/etcd --version"
  63. compile-setup-gopath-with-docker-test:
  64. $(info GO_VERSION: $(GO_VERSION))
  65. docker run \
  66. --rm \
  67. --mount type=bind,source=`pwd`,destination=/etcd \
  68. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  69. /bin/bash -c "cd /etcd && ETCD_SETUP_GOPATH=1 GO_BUILD_FLAGS=-v ./build && ./bin/etcd --version && rm -rf ./gopath"
  70. # Example:
  71. #
  72. # Local machine:
  73. # TEST_OPTS="PASSES='fmt'" make test -f ./hack/scripts-dev/Makefile
  74. # TEST_OPTS="PASSES='fmt bom dep compile build unit'" make test -f ./hack/scripts-dev/Makefile
  75. # TEST_OPTS="RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional'" make test -f ./hack/scripts-dev/Makefile
  76. # TEST_OPTS="PASSES='build grpcproxy'" make test -f ./hack/scripts-dev/Makefile
  77. #
  78. # Example (test with docker):
  79. # make pull-docker-test -f ./hack/scripts-dev/Makefile
  80. # TEST_OPTS="PASSES='fmt'" make docker-test -f ./hack/scripts-dev/Makefile
  81. # TEST_OPTS="VERBOSE=2 PASSES='unit'" make docker-test -f ./hack/scripts-dev/Makefile
  82. #
  83. # Travis CI (test with docker):
  84. # TEST_OPTS="PASSES='fmt bom dep compile build unit'" make docker-test -f ./hack/scripts-dev/Makefile
  85. #
  86. # Semaphore CI (test with docker):
  87. # TEST_OPTS="RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional'" make docker-test -f ./hack/scripts-dev/Makefile
  88. # HOST_TMP_DIR=/tmp TEST_OPTS="RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional'" make docker-test -f ./hack/scripts-dev/Makefile
  89. # TEST_OPTS="GOARCH=386 PASSES='build unit integration_e2e'" make docker-test -f ./hack/scripts-dev/Makefile
  90. #
  91. # grpc-proxy tests (test with docker):
  92. # TEST_OPTS="PASSES='build grpcproxy'" make docker-test -f ./hack/scripts-dev/Makefile
  93. # HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build grpcproxy'" make docker-test -f ./hack/scripts-dev/Makefile
  94. .PHONY: test
  95. test:
  96. $(info TEST_OPTS: $(TEST_OPTS))
  97. $(info log-file: test-$(TEST_SUFFIX).log)
  98. $(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log
  99. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
  100. docker-test:
  101. $(info GO_VERSION: $(GO_VERSION))
  102. $(info ETCD_VERSION: $(ETCD_VERSION))
  103. $(info TEST_OPTS: $(TEST_OPTS))
  104. $(info log-file: test-$(TEST_SUFFIX).log)
  105. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  106. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  107. docker run \
  108. --rm \
  109. $(TMP_DIR_MOUNT_FLAG) \
  110. --mount type=bind,source=`pwd`,destination=/go/src/github.com/coreos/etcd \
  111. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  112. /bin/bash -c "$(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log"
  113. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
  114. docker-test-coverage:
  115. $(info GO_VERSION: $(GO_VERSION))
  116. $(info ETCD_VERSION: $(ETCD_VERSION))
  117. $(info log-file: docker-test-coverage-$(TEST_SUFFIX).log)
  118. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  119. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  120. docker run \
  121. --rm \
  122. $(TMP_DIR_MOUNT_FLAG) \
  123. --mount type=bind,source=`pwd`,destination=/go/src/github.com/coreos/etcd \
  124. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  125. /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"
  126. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 docker-test-coverage-$(TEST_SUFFIX).log
  127. # Example:
  128. # ETCD_VERSION=v3.3.0-test.0 make build-docker-release-master -f ./hack/scripts-dev/Makefile
  129. # ETCD_VERSION=v3.3.0-test.0 make push-docker-release-master -f ./hack/scripts-dev/Makefile
  130. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  131. build-docker-release-master: compile-with-docker-test
  132. $(info ETCD_VERSION: $(ETCD_VERSION))
  133. cp ./Dockerfile-release ./bin/Dockerfile-release
  134. docker build \
  135. --tag gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
  136. --file ./bin/Dockerfile-release \
  137. ./bin
  138. rm -f ./bin/Dockerfile-release
  139. docker run \
  140. --rm \
  141. gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
  142. /bin/sh -c "/usr/local/bin/etcd --version && ETCDCTL_API=3 /usr/local/bin/etcdctl version"
  143. push-docker-release-master:
  144. $(info ETCD_VERSION: $(ETCD_VERSION))
  145. gcloud docker -- push gcr.io/etcd-development/etcd:$(ETCD_VERSION)
  146. # Example:
  147. # make build-docker-test -f ./hack/scripts-dev/Makefile
  148. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  149. # make build-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  150. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  151. # make push-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  152. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  153. # make pull-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  154. # make docker-static-ip-test-certs-run -f ./hack/scripts-dev/Makefile
  155. # make docker-static-ip-test-certs-metrics-proxy-run -f ./hack/scripts-dev/Makefile
  156. build-docker-static-ip-test:
  157. $(info GO_VERSION: $(GO_VERSION))
  158. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-static-ip/Dockerfile
  159. docker build \
  160. --tag gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  161. --file ./hack/scripts-dev/docker-static-ip/Dockerfile \
  162. ./hack/scripts-dev/docker-static-ip
  163. @mv ./hack/scripts-dev/docker-static-ip/Dockerfile.bak ./hack/scripts-dev/docker-static-ip/Dockerfile
  164. push-docker-static-ip-test:
  165. $(info GO_VERSION: $(GO_VERSION))
  166. gcloud docker -- push gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
  167. pull-docker-static-ip-test:
  168. $(info GO_VERSION: $(GO_VERSION))
  169. docker pull gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
  170. docker-static-ip-test-certs-run:
  171. $(info GO_VERSION: $(GO_VERSION))
  172. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  173. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  174. docker run \
  175. --rm \
  176. --tty \
  177. $(TMP_DIR_MOUNT_FLAG) \
  178. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  179. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-static-ip/certs,destination=/certs \
  180. gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  181. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  182. docker-static-ip-test-certs-metrics-proxy-run:
  183. $(info GO_VERSION: $(GO_VERSION))
  184. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  185. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  186. docker run \
  187. --rm \
  188. --tty \
  189. $(TMP_DIR_MOUNT_FLAG) \
  190. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  191. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-static-ip/certs-metrics-proxy,destination=/certs-metrics-proxy \
  192. gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  193. /bin/bash -c "cd /etcd && /certs-metrics-proxy/run.sh && rm -rf m*.etcd"
  194. # Example:
  195. # make build-docker-test -f ./hack/scripts-dev/Makefile
  196. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  197. # make build-docker-dns-test -f ./hack/scripts-dev/Makefile
  198. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  199. # make push-docker-dns-test -f ./hack/scripts-dev/Makefile
  200. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  201. # make pull-docker-dns-test -f ./hack/scripts-dev/Makefile
  202. # make docker-dns-test-insecure-run -f ./hack/scripts-dev/Makefile
  203. # make docker-dns-test-certs-run -f ./hack/scripts-dev/Makefile
  204. # make docker-dns-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  205. # make docker-dns-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  206. # make docker-dns-test-certs-common-name-auth-run -f ./hack/scripts-dev/Makefile
  207. # make docker-dns-test-certs-common-name-multi-run -f ./hack/scripts-dev/Makefile
  208. build-docker-dns-test:
  209. $(info GO_VERSION: $(GO_VERSION))
  210. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns/Dockerfile
  211. docker build \
  212. --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  213. --file ./hack/scripts-dev/docker-dns/Dockerfile \
  214. ./hack/scripts-dev/docker-dns
  215. @mv ./hack/scripts-dev/docker-dns/Dockerfile.bak ./hack/scripts-dev/docker-dns/Dockerfile
  216. docker run \
  217. --rm \
  218. --dns 127.0.0.1 \
  219. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  220. /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local"
  221. push-docker-dns-test:
  222. $(info GO_VERSION: $(GO_VERSION))
  223. gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  224. pull-docker-dns-test:
  225. $(info GO_VERSION: $(GO_VERSION))
  226. docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  227. docker-dns-test-insecure-run:
  228. $(info GO_VERSION: $(GO_VERSION))
  229. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  230. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  231. docker run \
  232. --rm \
  233. --tty \
  234. --dns 127.0.0.1 \
  235. $(TMP_DIR_MOUNT_FLAG) \
  236. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  237. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/insecure,destination=/insecure \
  238. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  239. /bin/bash -c "cd /etcd && /insecure/run.sh && rm -rf m*.etcd"
  240. docker-dns-test-certs-run:
  241. $(info GO_VERSION: $(GO_VERSION))
  242. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  243. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  244. docker run \
  245. --rm \
  246. --tty \
  247. --dns 127.0.0.1 \
  248. $(TMP_DIR_MOUNT_FLAG) \
  249. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  250. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs,destination=/certs \
  251. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  252. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  253. docker-dns-test-certs-gateway-run:
  254. $(info GO_VERSION: $(GO_VERSION))
  255. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  256. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  257. docker run \
  258. --rm \
  259. --tty \
  260. --dns 127.0.0.1 \
  261. $(TMP_DIR_MOUNT_FLAG) \
  262. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  263. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-gateway,destination=/certs-gateway \
  264. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  265. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  266. docker-dns-test-certs-wildcard-run:
  267. $(info GO_VERSION: $(GO_VERSION))
  268. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  269. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  270. docker run \
  271. --rm \
  272. --tty \
  273. --dns 127.0.0.1 \
  274. $(TMP_DIR_MOUNT_FLAG) \
  275. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  276. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-wildcard,destination=/certs-wildcard \
  277. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  278. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  279. docker-dns-test-certs-common-name-auth-run:
  280. $(info GO_VERSION: $(GO_VERSION))
  281. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  282. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  283. docker run \
  284. --rm \
  285. --tty \
  286. --dns 127.0.0.1 \
  287. $(TMP_DIR_MOUNT_FLAG) \
  288. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  289. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-common-name-auth,destination=/certs-common-name-auth \
  290. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  291. /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd"
  292. docker-dns-test-certs-common-name-multi-run:
  293. $(info GO_VERSION: $(GO_VERSION))
  294. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  295. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  296. docker run \
  297. --rm \
  298. --tty \
  299. --dns 127.0.0.1 \
  300. $(TMP_DIR_MOUNT_FLAG) \
  301. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  302. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-common-name-multi,destination=/certs-common-name-multi \
  303. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  304. /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd"
  305. # Example:
  306. # make build-docker-test -f ./hack/scripts-dev/Makefile
  307. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  308. # make build-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  309. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  310. # make push-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  311. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  312. # make pull-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  313. # make docker-dns-srv-test-certs-run -f ./hack/scripts-dev/Makefile
  314. # make docker-dns-srv-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  315. # make docker-dns-srv-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  316. build-docker-dns-srv-test:
  317. $(info GO_VERSION: $(GO_VERSION))
  318. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns-srv/Dockerfile
  319. docker build \
  320. --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  321. --file ./hack/scripts-dev/docker-dns-srv/Dockerfile \
  322. ./hack/scripts-dev/docker-dns-srv
  323. @mv ./hack/scripts-dev/docker-dns-srv/Dockerfile.bak ./hack/scripts-dev/docker-dns-srv/Dockerfile
  324. docker run \
  325. --rm \
  326. --dns 127.0.0.1 \
  327. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  328. /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"
  329. push-docker-dns-srv-test:
  330. $(info GO_VERSION: $(GO_VERSION))
  331. gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  332. pull-docker-dns-srv-test:
  333. $(info GO_VERSION: $(GO_VERSION))
  334. docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  335. docker-dns-srv-test-certs-run:
  336. $(info GO_VERSION: $(GO_VERSION))
  337. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  338. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  339. docker run \
  340. --rm \
  341. --tty \
  342. --dns 127.0.0.1 \
  343. $(TMP_DIR_MOUNT_FLAG) \
  344. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  345. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs,destination=/certs \
  346. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  347. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  348. docker-dns-srv-test-certs-gateway-run:
  349. $(info GO_VERSION: $(GO_VERSION))
  350. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  351. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  352. docker run \
  353. --rm \
  354. --tty \
  355. --dns 127.0.0.1 \
  356. $(TMP_DIR_MOUNT_FLAG) \
  357. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  358. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs-gateway,destination=/certs-gateway \
  359. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  360. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  361. docker-dns-srv-test-certs-wildcard-run:
  362. $(info GO_VERSION: $(GO_VERSION))
  363. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  364. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  365. docker run \
  366. --rm \
  367. --tty \
  368. --dns 127.0.0.1 \
  369. $(TMP_DIR_MOUNT_FLAG) \
  370. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  371. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs-wildcard,destination=/certs-wildcard \
  372. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  373. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  374. # Example:
  375. # make build-etcd-test-proxy -f ./hack/scripts-dev/Makefile
  376. build-etcd-test-proxy:
  377. go build -v -o ./bin/etcd-test-proxy ./tools/etcd-test-proxy
  378. # Example:
  379. # make build-docker-functional-tester -f ./hack/scripts-dev/Makefile
  380. # make push-docker-functional-tester -f ./hack/scripts-dev/Makefile
  381. # make pull-docker-functional-tester -f ./hack/scripts-dev/Makefile
  382. build-docker-functional-tester:
  383. $(info GO_VERSION: $(GO_VERSION))
  384. $(info ETCD_VERSION: $(ETCD_VERSION))
  385. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./Dockerfile-functional-tester
  386. docker build \
  387. --tag gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  388. --file ./Dockerfile-functional-tester \
  389. .
  390. @mv ./Dockerfile-functional-tester.bak ./Dockerfile-functional-tester
  391. docker run \
  392. --rm \
  393. gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  394. /bin/bash -c "/etcd --version && \
  395. /etcd-failpoints --version && \
  396. ETCDCTL_API=3 /etcdctl version && \
  397. /etcd-agent -help || true && \
  398. /etcd-tester -help || true && \
  399. /etcd-runner --help || true && \
  400. /benchmark --help || true && \
  401. /etcd-test-proxy -help || true"
  402. push-docker-functional-tester:
  403. $(info GO_VERSION: $(GO_VERSION))
  404. $(info ETCD_VERSION: $(ETCD_VERSION))
  405. gcloud docker -- push gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)
  406. pull-docker-functional-tester:
  407. $(info GO_VERSION: $(GO_VERSION))
  408. $(info ETCD_VERSION: $(ETCD_VERSION))
  409. docker pull gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)