Skip to content

Commit

Permalink
Merge pull request pinterest#196 from yyejun/docker_test
Browse files Browse the repository at this point in the history
docker test
  • Loading branch information
HenryCaiHaiying committed Apr 8, 2016
2 parents 2b9d718 + 8f6cbcc commit f3f9e49
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ bin/
.settings/
.project
.classpath
.m2
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TEST_HOME=/tmp/secor_test
TEST_CONFIG=src/test/config
JAR_FILE=target/secor-*-SNAPSHOT-bin.tar.gz
MVN_OPTS=-DskipTests=true -Dmaven.javadoc.skip=true
CONTAINERS=$(shell ls containers)

build:
@mvn package $(MVN_OPTS)
Expand All @@ -21,3 +22,14 @@ integration: build

test: build unit integration

container_%:
docker build -t secor_$* containers/$*

test_%: container_%
@mkdir -p .m2
docker run -v $(CURDIR)/.m2:/root/.m2:rw -v $(CURDIR):/work:rw secor_$* sh -c "echo 127.0.0.1 test-bucket.localhost >> /etc/hosts && make clean test"

docker_test: $(foreach container, $(CONTAINERS), test_$(container))

clean:
rm -rf target/
9 changes: 9 additions & 0 deletions containers/trusty/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:trusty

RUN apt-get update && \
apt-get -y install git make maven openjdk-7-jdk ruby s3cmd wget && \
gem install fakes3 -v 0.1.7

ENV SECOR_LOCAL_S3 true

WORKDIR /work
9 changes: 9 additions & 0 deletions containers/xenial/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:xenial

RUN apt-get update && \
apt-get -y install git make maven openjdk-8-jdk-headless ruby s3cmd wget && \
gem install fakes3 -v 0.2.4

ENV SECOR_LOCAL_S3 true

WORKDIR /work

0 comments on commit f3f9e49

Please sign in to comment.