working docker image which can run the acceptance tests

This commit is contained in:
Shane Kilkelly 2016-07-08 10:51:22 +01:00
parent c38d903f92
commit bca8f6c376
3 changed files with 30 additions and 3 deletions

View file

@ -1,10 +1,12 @@
FROM ubuntu
COPY ./test/acceptance/docker-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN apt-get update && apt-get upgrade
RUN apt-get install build-essential redis-server mongodb-server nodejs npm
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y build-essential redis-server mongodb-server nodejs npm
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN npm install -g grunt-cli
RUN mkdir /document-updater
VOLUME /document-updater

View file

@ -5,4 +5,11 @@ service mongodb start
cd /document-updater
npm install
grunt test:acceptance:docker
source ./test/acceptance/scripts/full-test.sh
service redis-server stop
service mongodb stop
exit 0

View file

@ -0,0 +1,18 @@
#! /usr/bin/env bash
echo ">> Starting server..."
grunt >> /dev/null &
_pid="$!"
echo ">> Server started with pid: $_pid"
sleep 20
echo ">> Running acceptance tests..."
grunt test:acceptance
echo ">> Killing server (pid: $_pid)"
kill -1 "$_pid"
echo ">> Done"