Makefile 18 KB

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