Makefile 18 KB

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