github.com/lfch/etcd-io/tests/v3@v3.0.0-20221004140520-eac99acd3e9d/manual/Makefile (about) 1 TMP_DOCKERFILE:=$(shell mktemp) 2 GO_VERSION ?= 1.19.1 3 TMP_DIR_MOUNT_FLAG = --tmpfs=/tmp:exec 4 ifdef HOST_TMP_DIR 5 TMP_DIR_MOUNT_FLAG = --mount type=bind,source=$(HOST_TMP_DIR),destination=/tmp 6 endif 7 8 # Example: 9 # make build-docker-test 10 # make compile-with-docker-test 11 # make build-docker-static-ip-test 12 # 13 # gcloud auth configure-docker 14 # make push-docker-static-ip-test 15 # 16 # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com 17 # make pull-docker-static-ip-test 18 # 19 # make docker-static-ip-test-certs-run 20 # make docker-static-ip-test-certs-metrics-proxy-run 21 22 build-docker-static-ip-test: 23 $(info GO_VERSION: $(GO_VERSION)) 24 @sed 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./docker-static-ip/Dockerfile > $(TMP_DOCKERFILE) 25 docker build \ 26 --network=host \ 27 --tag gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \ 28 --file ./docker-static-ip/Dockerfile \ 29 $(TMP_DOCKERFILE) 30 31 push-docker-static-ip-test: 32 $(info GO_VERSION: $(GO_VERSION)) 33 docker push gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) 34 35 pull-docker-static-ip-test: 36 $(info GO_VERSION: $(GO_VERSION)) 37 docker pull gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) 38 39 docker-static-ip-test-certs-run: 40 $(info GO_VERSION: $(GO_VERSION)) 41 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 42 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 43 docker run \ 44 --rm \ 45 --tty \ 46 $(TMP_DIR_MOUNT_FLAG) \ 47 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 48 --mount type=bind,source=`pwd`/tests/docker-static-ip/certs,destination=/certs \ 49 gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \ 50 /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd" 51 52 docker-static-ip-test-certs-metrics-proxy-run: 53 $(info GO_VERSION: $(GO_VERSION)) 54 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 55 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 56 docker run \ 57 --rm \ 58 --tty \ 59 $(TMP_DIR_MOUNT_FLAG) \ 60 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 61 --mount type=bind,source=`pwd`/tests/docker-static-ip/certs-metrics-proxy,destination=/certs-metrics-proxy \ 62 gcr.io/etcd-development/etcd-static-ip-test:go$(GO_VERSION) \ 63 /bin/bash -c "cd /etcd && /certs-metrics-proxy/run.sh && rm -rf m*.etcd" 64 65 66 67 # Example: 68 # make build-docker-test 69 # make compile-with-docker-test 70 # make build-docker-dns-test 71 # 72 # gcloud auth configure-docker 73 # make push-docker-dns-test 74 # 75 # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com 76 # make pull-docker-dns-test 77 # 78 # make docker-dns-test-insecure-run 79 # make docker-dns-test-certs-run 80 # make docker-dns-test-certs-gateway-run 81 # make docker-dns-test-certs-wildcard-run 82 # make docker-dns-test-certs-common-name-auth-run 83 # make docker-dns-test-certs-common-name-multi-run 84 # make docker-dns-test-certs-san-dns-run 85 86 build-docker-dns-test: 87 $(info GO_VERSION: $(GO_VERSION)) 88 @sed 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' ./docker-dns/Dockerfile > $(TMP_DOCKERFILE) 89 docker build \ 90 --network=host \ 91 --tag gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 92 --file ./docker-dns/Dockerfile \ 93 $(TMP_DOCKERFILE) 94 95 docker run \ 96 --rm \ 97 --dns 127.0.0.1 \ 98 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 99 /bin/bash -c "/etc/init.d/bind9 start && cat /dev/null >/etc/hosts && dig etcd.local" 100 101 push-docker-dns-test: 102 $(info GO_VERSION: $(GO_VERSION)) 103 docker push gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) 104 105 pull-docker-dns-test: 106 $(info GO_VERSION: $(GO_VERSION)) 107 docker pull gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) 108 109 docker-dns-test-insecure-run: 110 $(info GO_VERSION: $(GO_VERSION)) 111 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 112 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 113 docker run \ 114 --rm \ 115 --tty \ 116 --dns 127.0.0.1 \ 117 $(TMP_DIR_MOUNT_FLAG) \ 118 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 119 --mount type=bind,source=`pwd`/tests/docker-dns/insecure,destination=/insecure \ 120 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 121 /bin/bash -c "cd /etcd && /insecure/run.sh && rm -rf m*.etcd" 122 123 docker-dns-test-certs-run: 124 $(info GO_VERSION: $(GO_VERSION)) 125 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 126 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 127 docker run \ 128 --rm \ 129 --tty \ 130 --dns 127.0.0.1 \ 131 $(TMP_DIR_MOUNT_FLAG) \ 132 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 133 --mount type=bind,source=`pwd`/tests/docker-dns/certs,destination=/certs \ 134 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 135 /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd" 136 137 docker-dns-test-certs-gateway-run: 138 $(info GO_VERSION: $(GO_VERSION)) 139 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 140 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 141 docker run \ 142 --rm \ 143 --tty \ 144 --dns 127.0.0.1 \ 145 $(TMP_DIR_MOUNT_FLAG) \ 146 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 147 --mount type=bind,source=`pwd`/tests/docker-dns/certs-gateway,destination=/certs-gateway \ 148 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 149 /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd" 150 151 docker-dns-test-certs-wildcard-run: 152 $(info GO_VERSION: $(GO_VERSION)) 153 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 154 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 155 docker run \ 156 --rm \ 157 --tty \ 158 --dns 127.0.0.1 \ 159 $(TMP_DIR_MOUNT_FLAG) \ 160 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 161 --mount type=bind,source=`pwd`/tests/docker-dns/certs-wildcard,destination=/certs-wildcard \ 162 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 163 /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd" 164 165 docker-dns-test-certs-common-name-auth-run: 166 $(info GO_VERSION: $(GO_VERSION)) 167 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 168 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 169 docker run \ 170 --rm \ 171 --tty \ 172 --dns 127.0.0.1 \ 173 $(TMP_DIR_MOUNT_FLAG) \ 174 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 175 --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-auth,destination=/certs-common-name-auth \ 176 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 177 /bin/bash -c "cd /etcd && /certs-common-name-auth/run.sh && rm -rf m*.etcd" 178 179 docker-dns-test-certs-common-name-multi-run: 180 $(info GO_VERSION: $(GO_VERSION)) 181 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 182 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 183 docker run \ 184 --rm \ 185 --tty \ 186 --dns 127.0.0.1 \ 187 $(TMP_DIR_MOUNT_FLAG) \ 188 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 189 --mount type=bind,source=`pwd`/tests/docker-dns/certs-common-name-multi,destination=/certs-common-name-multi \ 190 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 191 /bin/bash -c "cd /etcd && /certs-common-name-multi/run.sh && rm -rf m*.etcd" 192 193 docker-dns-test-certs-san-dns-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 --dns 127.0.0.1 \ 201 $(TMP_DIR_MOUNT_FLAG) \ 202 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 203 --mount type=bind,source=`pwd`/tests/docker-dns/certs-san-dns,destination=/certs-san-dns \ 204 gcr.io/etcd-development/etcd-dns-test:go$(GO_VERSION) \ 205 /bin/bash -c "cd /etcd && /certs-san-dns/run.sh && rm -rf m*.etcd" 206 207 208 # Example: 209 # make build-docker-test 210 # make compile-with-docker-test 211 # make build-docker-dns-srv-test 212 # gcloud auth configure-docker 213 # make push-docker-dns-srv-test 214 # gsutil -m acl ch -u allUsers:R -r gs://artifacts.etcd-development.appspot.com 215 # make pull-docker-dns-srv-test 216 # make docker-dns-srv-test-certs-run 217 # make docker-dns-srv-test-certs-gateway-run 218 # make docker-dns-srv-test-certs-wildcard-run 219 220 build-docker-dns-srv-test: 221 $(info GO_VERSION: $(GO_VERSION)) 222 @sed 's|REPLACE_ME_GO_VERSION|$(GO_VERSION)|g' > $(TMP_DOCKERFILE) 223 docker build \ 224 --network=host \ 225 --tag gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ 226 --file ./docker-dns-srv/Dockerfile \ 227 $(TMP_DOCKERFILE) 228 229 docker run \ 230 --rm \ 231 --dns 127.0.0.1 \ 232 gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ 233 /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" 234 235 push-docker-dns-srv-test: 236 $(info GO_VERSION: $(GO_VERSION)) 237 docker push gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) 238 239 pull-docker-dns-srv-test: 240 $(info GO_VERSION: $(GO_VERSION)) 241 docker pull gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) 242 243 docker-dns-srv-test-certs-run: 244 $(info GO_VERSION: $(GO_VERSION)) 245 $(info HOST_TMP_DIR: $(HOST_TMP_DIR)) 246 $(info TMP_DIR_MOUNT_FLAG: $(TMP_DIR_MOUNT_FLAG)) 247 docker run \ 248 --rm \ 249 --tty \ 250 --dns 127.0.0.1 \ 251 $(TMP_DIR_MOUNT_FLAG) \ 252 --mount type=bind,source=`pwd`/bin,destination=/etcd \ 253 --mount type=bind,source=`pwd`/tests/docker-dns-srv/certs,destination=/certs \ 254 gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ 255 /bin/bash -c "cd /etcd && /certs/run.sh && rm -rf m*.etcd" 256 257 docker-dns-srv-test-certs-gateway-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-srv/certs-gateway,destination=/certs-gateway \ 268 gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ 269 /bin/bash -c "cd /etcd && /certs-gateway/run.sh && rm -rf m*.etcd" 270 271 docker-dns-srv-test-certs-wildcard-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-srv/certs-wildcard,destination=/certs-wildcard \ 282 gcr.io/etcd-development/etcd-dns-srv-test:go$(GO_VERSION) \ 283 /bin/bash -c "cd /etcd && /certs-wildcard/run.sh && rm -rf m*.etcd"