Makefile 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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.9.4
  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-certs-run -f ./hack/scripts-dev/Makefile
  195. # make docker-dns-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  196. # make docker-dns-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  197. # make docker-dns-test-certs-common-name-auth-run -f ./hack/scripts-dev/Makefile
  198. # make docker-dns-test-certs-common-name-multi-run -f ./hack/scripts-dev/Makefile
  199. build-docker-dns-test:
  200. $(info GO_VERSION: $(GO_VERSION))
  201. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns/Dockerfile
  202. docker build \
  203. --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  204. --file ./hack/scripts-dev/docker-dns/Dockerfile \
  205. ./hack/scripts-dev/docker-dns
  206. @mv ./hack/scripts-dev/docker-dns/Dockerfile.bak ./hack/scripts-dev/docker-dns/Dockerfile
  207. docker run \
  208. --rm \
  209. --dns 127.0.0.1 \
  210. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  211. /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local"
  212. push-docker-dns-test:
  213. $(info GO_VERSION: $(GO_VERSION))
  214. gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  215. pull-docker-dns-test:
  216. $(info GO_VERSION: $(GO_VERSION))
  217. docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  218. docker-dns-test-certs-run:
  219. $(info GO_VERSION: $(GO_VERSION))
  220. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  221. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  222. docker run \
  223. --rm \
  224. --tty \
  225. --dns 127.0.0.1 \
  226. $(TMP_DIR_MOUNT_FLAG) \
  227. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  228. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs,destination=/certs \
  229. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  230. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  231. docker-dns-test-certs-gateway-run:
  232. $(info GO_VERSION: $(GO_VERSION))
  233. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  234. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  235. docker run \
  236. --rm \
  237. --tty \
  238. --dns 127.0.0.1 \
  239. $(TMP_DIR_MOUNT_FLAG) \
  240. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  241. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-gateway,destination=/certs-gateway \
  242. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  243. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  244. docker-dns-test-certs-wildcard-run:
  245. $(info GO_VERSION: $(GO_VERSION))
  246. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  247. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  248. docker run \
  249. --rm \
  250. --tty \
  251. --dns 127.0.0.1 \
  252. $(TMP_DIR_MOUNT_FLAG) \
  253. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  254. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-wildcard,destination=/certs-wildcard \
  255. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  256. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  257. docker-dns-test-certs-common-name-auth-run:
  258. $(info GO_VERSION: $(GO_VERSION))
  259. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  260. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  261. docker run \
  262. --rm \
  263. --tty \
  264. --dns 127.0.0.1 \
  265. $(TMP_DIR_MOUNT_FLAG) \
  266. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  267. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-common-name-auth,destination=/certs-common-name-auth \
  268. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  269. /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd"
  270. docker-dns-test-certs-common-name-multi-run:
  271. $(info GO_VERSION: $(GO_VERSION))
  272. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  273. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  274. docker run \
  275. --rm \
  276. --tty \
  277. --dns 127.0.0.1 \
  278. $(TMP_DIR_MOUNT_FLAG) \
  279. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  280. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns/certs-common-name-multi,destination=/certs-common-name-multi \
  281. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  282. /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd"
  283. # Example:
  284. # make build-docker-test -f ./hack/scripts-dev/Makefile
  285. # make compile-with-docker-test -f ./hack/scripts-dev/Makefile
  286. # make build-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  287. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  288. # make push-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  289. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  290. # make pull-docker-dns-srv-test -f ./hack/scripts-dev/Makefile
  291. # make docker-dns-srv-test-certs-run -f ./hack/scripts-dev/Makefile
  292. # make docker-dns-srv-test-certs-gateway-run -f ./hack/scripts-dev/Makefile
  293. # make docker-dns-srv-test-certs-wildcard-run -f ./hack/scripts-dev/Makefile
  294. build-docker-dns-srv-test:
  295. $(info GO_VERSION: $(GO_VERSION))
  296. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./hack/scripts-dev/docker-dns-srv/Dockerfile
  297. docker build \
  298. --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  299. --file ./hack/scripts-dev/docker-dns-srv/Dockerfile \
  300. ./hack/scripts-dev/docker-dns-srv
  301. @mv ./hack/scripts-dev/docker-dns-srv/Dockerfile.bak ./hack/scripts-dev/docker-dns-srv/Dockerfile
  302. docker run \
  303. --rm \
  304. --dns 127.0.0.1 \
  305. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  306. /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"
  307. push-docker-dns-srv-test:
  308. $(info GO_VERSION: $(GO_VERSION))
  309. gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  310. pull-docker-dns-srv-test:
  311. $(info GO_VERSION: $(GO_VERSION))
  312. docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  313. docker-dns-srv-test-certs-run:
  314. $(info GO_VERSION: $(GO_VERSION))
  315. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  316. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  317. docker run \
  318. --rm \
  319. --tty \
  320. --dns 127.0.0.1 \
  321. $(TMP_DIR_MOUNT_FLAG) \
  322. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  323. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs,destination=/certs \
  324. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  325. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  326. docker-dns-srv-test-certs-gateway-run:
  327. $(info GO_VERSION: $(GO_VERSION))
  328. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  329. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  330. docker run \
  331. --rm \
  332. --tty \
  333. --dns 127.0.0.1 \
  334. $(TMP_DIR_MOUNT_FLAG) \
  335. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  336. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs-gateway,destination=/certs-gateway \
  337. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  338. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  339. docker-dns-srv-test-certs-wildcard-run:
  340. $(info GO_VERSION: $(GO_VERSION))
  341. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  342. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  343. docker run \
  344. --rm \
  345. --tty \
  346. --dns 127.0.0.1 \
  347. $(TMP_DIR_MOUNT_FLAG) \
  348. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  349. --mount type=bind,source=`pwd`/hack/scripts-dev/docker-dns-srv/certs-wildcard,destination=/certs-wildcard \
  350. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  351. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  352. # Example:
  353. # make build-etcd-test-proxy -f ./hack/scripts-dev/Makefile
  354. build-etcd-test-proxy:
  355. go build -v -o ./bin/etcd-test-proxy ./tools/etcd-test-proxy
  356. # Example:
  357. # make build-docker-functional-tester -f ./hack/scripts-dev/Makefile
  358. # make push-docker-functional-tester -f ./hack/scripts-dev/Makefile
  359. # make pull-docker-functional-tester -f ./hack/scripts-dev/Makefile
  360. build-docker-functional-tester:
  361. $(info GO_VERSION: $(GO_VERSION))
  362. $(info ETCD_VERSION: $(ETCD_VERSION))
  363. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./Dockerfile-functional-tester
  364. docker build \
  365. --tag gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  366. --file ./Dockerfile-functional-tester \
  367. .
  368. @mv ./Dockerfile-functional-tester.bak ./Dockerfile-functional-tester
  369. docker run \
  370. --rm \
  371. gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION) \
  372. /bin/bash -c "/etcd --version && \
  373. /etcd-failpoints --version && \
  374. ETCDCTL_API=3 /etcdctl version && \
  375. /etcd-agent -help || true && \
  376. /etcd-tester -help || true && \
  377. /etcd-runner --help || true && \
  378. /benchmark --help || true && \
  379. /etcd-test-proxy -help || true"
  380. push-docker-functional-tester:
  381. $(info GO_VERSION: $(GO_VERSION))
  382. $(info ETCD_VERSION: $(ETCD_VERSION))
  383. gcloud docker -- push gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)
  384. pull-docker-functional-tester:
  385. $(info GO_VERSION: $(GO_VERSION))
  386. $(info ETCD_VERSION: $(ETCD_VERSION))
  387. docker pull gcr.io/etcd-development/etcd-functional-tester:go$(GO_VERSION)