Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration testing #64

Merged
merged 2 commits into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:

env:
matrix:
- DOCKER_VERSION=1.13.1-0~ubuntu-trusty
- DOCKER_VERSION=1.12.6-0~ubuntu-trusty
- DOCKER_TAG=1.13-dind
- DOCKER_TAG=1.12-dind
global:
- DEBUG='navy:*' NAVY_DEBUG='navy:*' DOCKER_COMPOSE_VERSION=1.8.0

Expand All @@ -28,27 +28,13 @@ matrix:

include:
- node_js: 6
env: DOCKER_VERSION=1.11.2-0~trusty
env: DOCKER_TAG=1.11-dind
- node_js: 6
env: DOCKER_VERSION=1.10.3-0~trusty
env: DOCKER_TAG=1.10-dind

before_install:
# list docker-engine versions
- apt-cache madison docker-engine

# upgrade docker-engine to specific version
- sudo apt-get purge -y docker-engine
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}

# reinstall docker-compose at specific version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

# print versions
- docker --version
- docker-compose --version

before_script:
# bootstrap packages
Expand Down
15 changes: 13 additions & 2 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
set -e

echo ""
echo "SETTING UP ENVIRONMENT"
echo "This may take several minutes to build the necessary docker containers..."
echo "This will only take a while the first time you run the tests, subsequent runs should be faster"
echo ""
echo ""

DOCKER_TAG=${DOCKER_TAG:-1.12-dind}
DOCKER_COMPOSE_VERSION=${DOCKER_COMPOSE_VERSION:-1.8.0}
NODE_VERSION=${TRAVIS_NODE_VERSION:-6}

docker run -d --name navy-test-runner-daemon --privileged \
-v $(pwd):/usr/src/app \
docker:1.12-dind --storage-driver=aufs
docker:$DOCKER_TAG --storage-driver=aufs

docker build -t navy-test-runner -f test/integration/runner/Dockerfile .
docker build \
-t navy-test-runner \
-f test/integration/runner/Dockerfile \
--build-arg DOCKER_COMPOSE_VERSION=$DOCKER_COMPOSE_VERSION \
--build-arg NODE_VERSION=$NODE_VERSION \
.

echo ""
echo ""
Expand Down
9 changes: 4 additions & 5 deletions test/integration/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM ubuntu

ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 1.12.0
ENV DOCKER_SHA256 3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b
ARG DOCKER_COMPOSE_VERSION
ARG NODE_VERSION

RUN apt-get update -y && apt-get install -y build-essential git curl

RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && apt-get install -y nodejs python-software-properties python
RUN curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - && apt-get install -y nodejs python-software-properties python

RUN curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
RUN curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose

ADD ./test/integration/runner/docker-entrypoint.sh /usr/local/bin/
Expand Down