Makefile 18 KB

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