go.etcd.io/etcd@v3.3.27+incompatible/hack/scripts-dev/Makefile (about)

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