Makefile 17 KB

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