Makefile 19 KB

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