Makefile 17 KB

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