Makefile 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  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.12.9
  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.12.9 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.12.9 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. build-docker-dns-test:
  237. $(info GO_VERSION: $(GO_VERSION))
  238. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns/Dockerfile
  239. docker build \
  240. --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  241. --file ./tests/docker-dns/Dockerfile \
  242. ./tests/docker-dns
  243. @mv ./tests/docker-dns/Dockerfile.bak ./tests/docker-dns/Dockerfile
  244. docker run \
  245. --rm \
  246. --dns 127.0.0.1 \
  247. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  248. /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local"
  249. push-docker-dns-test:
  250. $(info GO_VERSION: $(GO_VERSION))
  251. gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  252. pull-docker-dns-test:
  253. $(info GO_VERSION: $(GO_VERSION))
  254. docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION)
  255. docker-dns-test-insecure-run:
  256. $(info GO_VERSION: $(GO_VERSION))
  257. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  258. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  259. docker run \
  260. --rm \
  261. --tty \
  262. --dns 127.0.0.1 \
  263. $(TMP_DIR_MOUNT_FLAG) \
  264. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  265. --mount type=bind,source=`pwd`/tests/docker-dns/insecure,destination=/insecure \
  266. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  267. /bin/bash -c "cd /etcd && /insecure/run.sh && rm -rf m*.etcd"
  268. docker-dns-test-certs-run:
  269. $(info GO_VERSION: $(GO_VERSION))
  270. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  271. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  272. docker run \
  273. --rm \
  274. --tty \
  275. --dns 127.0.0.1 \
  276. $(TMP_DIR_MOUNT_FLAG) \
  277. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  278. --mount type=bind,source=`pwd`/tests/docker-dns/certs,destination=/certs \
  279. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  280. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  281. docker-dns-test-certs-gateway-run:
  282. $(info GO_VERSION: $(GO_VERSION))
  283. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  284. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  285. docker run \
  286. --rm \
  287. --tty \
  288. --dns 127.0.0.1 \
  289. $(TMP_DIR_MOUNT_FLAG) \
  290. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  291. --mount type=bind,source=`pwd`/tests/docker-dns/certs-gateway,destination=/certs-gateway \
  292. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  293. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  294. docker-dns-test-certs-wildcard-run:
  295. $(info GO_VERSION: $(GO_VERSION))
  296. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  297. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  298. docker run \
  299. --rm \
  300. --tty \
  301. --dns 127.0.0.1 \
  302. $(TMP_DIR_MOUNT_FLAG) \
  303. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  304. --mount type=bind,source=`pwd`/tests/docker-dns/certs-wildcard,destination=/certs-wildcard \
  305. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  306. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  307. docker-dns-test-certs-common-name-auth-run:
  308. $(info GO_VERSION: $(GO_VERSION))
  309. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  310. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  311. docker run \
  312. --rm \
  313. --tty \
  314. --dns 127.0.0.1 \
  315. $(TMP_DIR_MOUNT_FLAG) \
  316. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  317. --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-auth,destination=/certs-common-name-auth \
  318. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  319. /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd"
  320. docker-dns-test-certs-common-name-multi-run:
  321. $(info GO_VERSION: $(GO_VERSION))
  322. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  323. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  324. docker run \
  325. --rm \
  326. --tty \
  327. --dns 127.0.0.1 \
  328. $(TMP_DIR_MOUNT_FLAG) \
  329. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  330. --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-multi,destination=/certs-common-name-multi \
  331. gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \
  332. /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd"
  333. # Example:
  334. # make build-docker-test
  335. # make compile-with-docker-test
  336. # make build-docker-dns-srv-test
  337. # gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd-development.json)" https://gcr.io
  338. # make push-docker-dns-srv-test
  339. # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com
  340. # make pull-docker-dns-srv-test
  341. # make docker-dns-srv-test-certs-run
  342. # make docker-dns-srv-test-certs-gateway-run
  343. # make docker-dns-srv-test-certs-wildcard-run
  344. build-docker-dns-srv-test:
  345. $(info GO_VERSION: $(GO_VERSION))
  346. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./tests/docker-dns-srv/Dockerfile
  347. docker build \
  348. --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  349. --file ./tests/docker-dns-srv/Dockerfile \
  350. ./tests/docker-dns-srv
  351. @mv ./tests/docker-dns-srv/Dockerfile.bak ./tests/docker-dns-srv/Dockerfile
  352. docker run \
  353. --rm \
  354. --dns 127.0.0.1 \
  355. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  356. /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"
  357. push-docker-dns-srv-test:
  358. $(info GO_VERSION: $(GO_VERSION))
  359. gcloud docker -- push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  360. pull-docker-dns-srv-test:
  361. $(info GO_VERSION: $(GO_VERSION))
  362. docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION)
  363. docker-dns-srv-test-certs-run:
  364. $(info GO_VERSION: $(GO_VERSION))
  365. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  366. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  367. docker run \
  368. --rm \
  369. --tty \
  370. --dns 127.0.0.1 \
  371. $(TMP_DIR_MOUNT_FLAG) \
  372. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  373. --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs,destination=/certs \
  374. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  375. /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd"
  376. docker-dns-srv-test-certs-gateway-run:
  377. $(info GO_VERSION: $(GO_VERSION))
  378. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  379. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  380. docker run \
  381. --rm \
  382. --tty \
  383. --dns 127.0.0.1 \
  384. $(TMP_DIR_MOUNT_FLAG) \
  385. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  386. --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs-gateway,destination=/certs-gateway \
  387. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  388. /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd"
  389. docker-dns-srv-test-certs-wildcard-run:
  390. $(info GO_VERSION: $(GO_VERSION))
  391. $(info HOST_TMP_DIR: $(HOST_TMP_DIR))
  392. $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG))
  393. docker run \
  394. --rm \
  395. --tty \
  396. --dns 127.0.0.1 \
  397. $(TMP_DIR_MOUNT_FLAG) \
  398. --mount type=bind,source=`pwd`/bin,destination=/etcd \
  399. --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs-wildcard,destination=/certs-wildcard \
  400. gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \
  401. /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"
  402. # Example:
  403. # make build-functional
  404. # make build-docker-functional
  405. # make push-docker-functional
  406. # make pull-docker-functional
  407. build-functional:
  408. $(info GO_VERSION: $(GO_VERSION))
  409. $(info ETCD_VERSION: $(ETCD_VERSION))
  410. ./functional/build
  411. ./bin/etcd-agent -help || true && \
  412. ./bin/etcd-proxy -help || true && \
  413. ./bin/etcd-runner --help || true && \
  414. ./bin/etcd-tester -help || true
  415. build-docker-functional:
  416. $(info GO_VERSION: $(GO_VERSION))
  417. $(info ETCD_VERSION: $(ETCD_VERSION))
  418. @sed -i.bak 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./functional/Dockerfile
  419. docker build \
  420. --tag gcr.io/etcd-development/etcd-functional:go$(GO_VERSION) \
  421. --file ./functional/Dockerfile \
  422. .
  423. @mv ./functional/Dockerfile.bak ./functional/Dockerfile
  424. docker run \
  425. --rm \
  426. gcr.io/etcd-development/etcd-functional:go$(GO_VERSION) \
  427. /bin/bash -c "./bin/etcd --version && \
  428. ./bin/etcd-failpoints --version && \
  429. ./bin/etcdctl version && \
  430. ./bin/etcd-agent -help || true && \
  431. ./bin/etcd-proxy -help || true && \
  432. ./bin/etcd-runner --help || true && \
  433. ./bin/etcd-tester -help || true && \
  434. ./bin/benchmark --help || true"
  435. push-docker-functional:
  436. $(info GO_VERSION: $(GO_VERSION))
  437. $(info ETCD_VERSION: $(ETCD_VERSION))
  438. gcloud docker -- push gcr.io/etcd-development/etcd-functional:go$(GO_VERSION)
  439. pull-docker-functional:
  440. $(info GO_VERSION: $(GO_VERSION))
  441. $(info ETCD_VERSION: $(ETCD_VERSION))
  442. docker pull gcr.io/etcd-development/etcd-functional:go$(GO_VERSION)