Makefile 18 KB

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