Makefile 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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. compile-with-docker-test:
  56. $(info GO_VERSION: $(GO_VERSION))
  57. docker run \
  58. --rm \
  59. --mount type=bind,source=`pwd`,destination=/etcd \
  60. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  61. /bin/bash -c "cd /etcd && GO_BUILD_FLAGS=-v ./build && ./bin/etcd --version"
  62. # Example:
  63. #
  64. # Local machine:
  65. # TEST_OPTS="PASSES='fmt'" make test -f ./hack/scripts-dev/Makefile
  66. # TEST_OPTS="PASSES='fmt bom dep compile build unit'" make test -f ./hack/scripts-dev/Makefile
  67. # TEST_OPTS="RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional'" make test -f ./hack/scripts-dev/Makefile
  68. # TEST_OPTS="PASSES='build grpcproxy'" make test -f ./hack/scripts-dev/Makefile
  69. #
  70. # Example (test with docker):
  71. # make pull-docker-test -f ./hack/scripts-dev/Makefile
  72. # TEST_OPTS="PASSES='fmt'" make docker-test -f ./hack/scripts-dev/Makefile
  73. # TEST_OPTS="VERBOSE=2 PASSES='unit'" make docker-test -f ./hack/scripts-dev/Makefile
  74. #
  75. # Travis CI (test with docker):
  76. # TEST_OPTS="PASSES='fmt bom dep compile build unit'" make docker-test -f ./hack/scripts-dev/Makefile
  77. #
  78. # Semaphore CI (test with docker):
  79. # TEST_OPTS="RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional'" make docker-test -f ./hack/scripts-dev/Makefile
  80. # 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
  81. # TEST_OPTS="GOARCH=386 PASSES='build unit integration_e2e'" make docker-test -f ./hack/scripts-dev/Makefile
  82. #
  83. # grpc-proxy tests (test with docker):
  84. # TEST_OPTS="PASSES='build grpcproxy'" make docker-test -f ./hack/scripts-dev/Makefile
  85. # HOST_TMP_DIR=/tmp TEST_OPTS="PASSES='build grpcproxy'" make docker-test -f ./hack/scripts-dev/Makefile
  86. .PHONY: test
  87. test:
  88. $(info TEST_OPTS: $(TEST_OPTS))
  89. $(info log-file: test-$(TEST_SUFFIX).log)
  90. $(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log
  91. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
  92. docker-test:
  93. $(info GO_VERSION: $(GO_VERSION))
  94. $(info ETCD_VERSION: $(ETCD_VERSION))
  95. $(info TEST_OPTS: $(TEST_OPTS))
  96. $(info log-file: test-$(TEST_SUFFIX).log)
  97. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  98. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  99. docker run \
  100. --rm \
  101. $(TMP_DIR_MOUNT_FLAG) \
  102. --mount type=bind,source=`pwd`,destination=/go/src/github.com/coreos/etcd \
  103. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  104. /bin/bash -c "$(TEST_OPTS) ./test 2>&1 | tee test-$(TEST_SUFFIX).log"
  105. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 test-$(TEST_SUFFIX).log
  106. docker-test-coverage:
  107. $(info GO_VERSION: $(GO_VERSION))
  108. $(info ETCD_VERSION: $(ETCD_VERSION))
  109. $(info log-file: docker-test-coverage-$(TEST_SUFFIX).log)
  110. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  111. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  112. docker run \
  113. --rm \
  114. $(TMP_DIR_MOUNT_FLAG) \
  115. --mount type=bind,source=`pwd`,destination=/go/src/github.com/coreos/etcd \
  116. gcr.io/etcd-development/etcd-test:go$(GO_VERSION) \
  117. /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"
  118. ! egrep "(--- FAIL:|panic: test timed out|appears to have leaked)" -B50 -A10 docker-test-coverage-$(TEST_SUFFIX).log
  119. # Example:
  120. # ETCD_VERSION=v3.3.0-test.0 make build-docker-release-master -f ./hack/scripts-dev/Makefile
  121. # ETCD_VERSION=v3.3.0-test.0 make push-docker-release-master -f ./hack/scripts-dev/Makefile
  122. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  123. build-docker-release-master: compile-with-docker-test
  124. $(info ETCD_VERSION: $(ETCD_VERSION))
  125. cp ./Dockerfile-release ./bin/Dockerfile-release
  126. docker build \
  127. --tag gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
  128. --file ./bin/Dockerfile-release \
  129. ./bin
  130. rm -f ./bin/Dockerfile-release
  131. docker run \
  132. --rm \
  133. gcr.io/etcd-development/etcd:$(ETCD_VERSION) \
  134. /bin/sh -c "/usr/local/bin/etcd --version && ETCDCTL_API=3 /usr/local/bin/etcdctl version"
  135. push-docker-release-master:
  136. $(info ETCD_VERSION: $(ETCD_VERSION))
  137. gcloud docker -- push gcr.io/etcd-development/etcd:$(ETCD_VERSION)
  138. # Example:
  139. # make build-docker-test -f ./hack/scripts-dev/Makefile
  140. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  141. # make build-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  142. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  143. # make push-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  144. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  145. # make pull-docker-static-ip-test -f ./hack/scripts-dev/Makefile
  146. # make docker-static-ip-test-certs-run -f ./hack/scripts-dev/Makefile
  147. # make docker-static-ip-test-certs-metrics-proxy-run -f ./hack/scripts-dev/Makefile
  148. build-docker-static-ip-test:
  149. $(info GO_VERSION: $(GO_VERSION))
  150. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-static-ip/Dockerfile
  151. docker build \
  152. --tag gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  153. --file ./hack/scripts-dev/docker-static-ip/Dockerfile \
  154. ./hack/scripts-dev/docker-static-ip
  155. @mv ./hack/scripts-dev/docker-static-ip/Dockerfile.bak ./hack/scripts-dev/docker-static-ip/Dockerfile
  156. push-docker-static-ip-test:
  157. $(info GO_VERSION: $(GO_VERSION))
  158. gcloud docker -- push gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
  159. pull-docker-static-ip-test:
  160. $(info GO_VERSION: $(GO_VERSION))
  161. docker pull gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION)
  162. docker-static-ip-test-certs-run:
  163. $(info GO_VERSION: $(GO_VERSION))
  164. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  165. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  166. docker run \
  167. --rm \
  168. --tty \
  169. $(TMP_DIR_MOUNT_FLAG) \
  170. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  171. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-static-ip/certs,destination=/certs \
  172. gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  173. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  174. docker-static-ip-test-certs-metrics-proxy-run:
  175. $(info GO_VERSION: $(GO_VERSION))
  176. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  177. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  178. docker run \
  179. --rm \
  180. --tty \
  181. $(TMP_DIR_MOUNT_FLAG) \
  182. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  183. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-static-ip/certs-metrics-proxy,destination=/certs-metrics-proxy \
  184. gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \
  185. /bin/bash -c "cd /etcd && /certs-metrics-proxy/run.sh && rm -rf m*.etcd"
  186. # Example:
  187. # make build-docker-test -f ./hack/scripts-dev/Makefile
  188. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  189. # make build-docker-dns-test -f ./hack/scripts-dev/Makefile
  190. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  191. # make push-docker-dns-test -f ./hack/scripts-dev/Makefile
  192. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  193. # make pull-docker-dns-test -f ./hack/scripts-dev/Makefile
  194. # make docker-dns-test-insecure-run -f ./hack/scripts-dev/Makefile
  195. # make docker-dns-test-certs-run -f ./hack/scripts-dev/Makefile
  196. # make docker-dns-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  197. # make docker-dns-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  198. # make docker-dns-test-certs-common-name-auth-run -f ./hack/scripts-dev/Makefile
  199. # make docker-dns-test-certs-common-name-multi-run -f ./hack/scripts-dev/Makefile
  200. build-docker-dns-test:
  201. $(info GO_VERSION: $(GO_VERSION))
  202. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns/Dockerfile
  203. docker build \
  204. --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  205. --file ./hack/scripts-dev/docker-dns/Dockerfile \
  206. ./hack/scripts-dev/docker-dns
  207. @mv ./hack/scripts-dev/docker-dns/Dockerfile.bak ./hack/scripts-dev/docker-dns/Dockerfile
  208. docker run \
  209. --rm \
  210. --dns 127.0.0.1 \
  211. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  212. /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local"
  213. push-docker-dns-test:
  214. $(info GO_VERSION: $(GO_VERSION))
  215. gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  216. pull-docker-dns-test:
  217. $(info GO_VERSION: $(GO_VERSION))
  218. docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  219. docker-dns-test-insecure-run:
  220. $(info GO_VERSION: $(GO_VERSION))
  221. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  222. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  223. docker run \
  224. --rm \
  225. --tty \
  226. --dns 127.0.0.1 \
  227. $(TMP_DIR_MOUNT_FLAG) \
  228. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  229. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/insecure,destination=/insecure \
  230. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  231. /bin/bash -c "cd /etcd && /insecure/run.sh && rm -rf m*.etcd"
  232. docker-dns-test-certs-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/certs,destination=/certs \
  243. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  244. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  245. docker-dns-test-certs-gateway-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-gateway,destination=/certs-gateway \
  256. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  257. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  258. docker-dns-test-certs-wildcard-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-wildcard,destination=/certs-wildcard \
  269. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  270. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  271. docker-dns-test-certs-common-name-auth-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-common-name-auth,destination=/certs-common-name-auth \
  282. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  283. /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd"
  284. docker-dns-test-certs-common-name-multi-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-multi,destination=/certs-common-name-multi \
  295. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  296. /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd"
  297. # Example:
  298. # make build-docker-test -f ./hack/scripts-dev/Makefile
  299. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  300. # make build-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  301. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  302. # make push-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  303. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  304. # make pull-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  305. # make docker-dns-srv-test-certs-run -f ./hack/scripts-dev/Makefile
  306. # make docker-dns-srv-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  307. # make docker-dns-srv-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  308. build-docker-dns-srv-test:
  309. $(info GO_VERSION: $(GO_VERSION))
  310. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns-srv/Dockerfile
  311. docker build \
  312. --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  313. --file ./hack/scripts-dev/docker-dns-srv/Dockerfile \
  314. ./hack/scripts-dev/docker-dns-srv
  315. @mv ./hack/scripts-dev/docker-dns-srv/Dockerfile.bak ./hack/scripts-dev/docker-dns-srv/Dockerfile
  316. docker run \
  317. --rm \
  318. --dns 127.0.0.1 \
  319. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  320. /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"
  321. push-docker-dns-srv-test:
  322. $(info GO_VERSION: $(GO_VERSION))
  323. gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  324. pull-docker-dns-srv-test:
  325. $(info GO_VERSION: $(GO_VERSION))
  326. docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  327. docker-dns-srv-test-certs-run:
  328. $(info GO_VERSION: $(GO_VERSION))
  329. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  330. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  331. docker run \
  332. --rm \
  333. --tty \
  334. --dns 127.0.0.1 \
  335. $(TMP_DIR_MOUNT_FLAG) \
  336. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  337. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs,destination=/certs \
  338. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  339. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  340. docker-dns-srv-test-certs-gateway-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-gateway,destination=/certs-gateway \
  351. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  352. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  353. docker-dns-srv-test-certs-wildcard-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-wildcard,destination=/certs-wildcard \
  364. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  365. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  366. # Example:
  367. # make build-etcd-test-proxy -f ./hack/scripts-dev/Makefile
  368. build-etcd-test-proxy:
  369. go build -v -o ./bin/etcd-test-proxy ./tools/etcd-test-proxy
  370. # Example:
  371. # make build-docker-functional-tester -f ./hack/scripts-dev/Makefile
  372. # make push-docker-functional-tester -f ./hack/scripts-dev/Makefile
  373. # make pull-docker-functional-tester -f ./hack/scripts-dev/Makefile
  374. build-docker-functional-tester:
  375. $(info GO_VERSION: $(GO_VERSION))
  376. $(info ETCD_VERSION: $(ETCD_VERSION))
  377. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./Dockerfile-functional-tester
  378. docker build \
  379. --tag gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  380. --file ./Dockerfile-functional-tester \
  381. .
  382. @mv ./Dockerfile-functional-tester.bak ./Dockerfile-functional-tester
  383. docker run \
  384. --rm \
  385. gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  386. /bin/bash -c "/etcd --version && \
  387. /etcd-failpoints --version && \
  388. ETCDCTL_API=3 /etcdctl version && \
  389. /etcd-agent -help || true && \
  390. /etcd-tester -help || true && \
  391. /etcd-runner --help || true && \
  392. /benchmark --help || true && \
  393. /etcd-test-proxy -help || true"
  394. push-docker-functional-tester:
  395. $(info GO_VERSION: $(GO_VERSION))
  396. $(info ETCD_VERSION: $(ETCD_VERSION))
  397. gcloud docker -- push gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)
  398. pull-docker-functional-tester:
  399. $(info GO_VERSION: $(GO_VERSION))
  400. $(info ETCD_VERSION: $(ETCD_VERSION))
  401. docker pull gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)