Makefile 19 KB

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