Skip to content

Commit

Permalink
Makefile: initial commit with 'docker-dns-test'
Browse files Browse the repository at this point in the history
For etcd-io#8502.
First step to make DNS/SRV tests easier to run.

```
make docker-dns-test-build
make docker-dns-test
```

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Sep 29, 2017
1 parent 2cfe0d6 commit ddff727
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# gcloud docker -- login -u _json_key -p "$(cat /etc/gcp-key-etcd.json)" https://gcr.io

.PHONY: build
build:
GO_BUILD_FLAGS="-v" ./build
rm -rf ./gopath
./bin/etcd --version
ETCDCTL_API=3 ./bin/etcdctl version

docker-test-build:
docker build --tag gcr.io/etcd-development/etcd-test:latest --file ./Dockerfile-test .

docker-test-push:
gcloud docker -- push gcr.io/etcd-development/etcd-test:latest

docker-test:
docker run \
--rm \
--volume=`pwd`:/go/src/github.com/coreos/etcd \
gcr.io/etcd-development/etcd-test:latest \
/bin/bash -c "RELEASE_TEST=y INTEGRATION=y PASSES='build unit release integration_e2e functional' ./test 2>&1 | tee docker-test.log"

docker-dns-test-build:
docker build \
--tag gcr.io/etcd-development/etcd-dns-test:latest \
--file ./e2e/docker/Dockerfile \
./e2e/docker

# compile with debian base image
docker run \
--rm \
--volume=`pwd`/:/etcd \
gcr.io/etcd-development/etcd-dns-test:latest \
/bin/bash -c "pushd /etcd && GO_BUILD_FLAGS=-v ./build && popd && /etcd/bin/etcd --version"

docker-dns-test-push:
gcloud docker -- push gcr.io/etcd-development/etcd-dns-test:latest

docker-dns-test:
docker run \
--rm \
--tty \
--dns 127.0.0.1 \
--volume=`pwd`/bin:/etcd \
--volume=`pwd`/integration/fixtures:/certs \
gcr.io/etcd-development/etcd-dns-test:latest \
/bin/bash -c "pushd /etcd && /run.sh && rm -rf infra*.etcd && popd"
14 changes: 10 additions & 4 deletions e2e/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM golang:1.9-stretch
LABEL Description="Image for etcd DNS testing"
RUN apt update -y
RUN go get github.com/mattn/goreman
RUN apt install -y bind9

RUN apt update -y \
&& apt install -y \
bind9 \
dnsutils

RUN mkdir /var/bind
RUN chown bind /var/bind
ADD Procfile.tls /Procfile.tls
ADD run.sh /run.sh

ADD named.conf etcd.zone rdns.zone /etc/bind/
ADD resolv.conf /etc/resolv.conf
CMD ["/run.sh"]

RUN go get github.com/mattn/goreman
CMD ["/run.sh"]
7 changes: 0 additions & 7 deletions e2e/docker/Makefile

This file was deleted.

0 comments on commit ddff727

Please sign in to comment.