Makefile 19 KB

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