diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..e64c35dd6b8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.tox +.git diff --git a/.gitignore b/.gitignore index 64ab38f2da8..b8e6c24ece6 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,8 @@ develop-eggs lib lib64 -# Installer logs +# Logs +*.log pip-log.txt # Unit test / coverage reports diff --git a/script/lint_docker b/script/lint_docker new file mode 100755 index 00000000000..61f4e4be96a --- /dev/null +++ b/script/lint_docker @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.test . +docker run --rm -it home-assistant-test tox -e lint diff --git a/script/test_docker b/script/test_docker new file mode 100755 index 00000000000..ab2296cf5fc --- /dev/null +++ b/script/test_docker @@ -0,0 +1,5 @@ +#!/bin/bash +set -e + +docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.test . +docker run --rm -it home-assistant-test tox -e py34 diff --git a/virtualization/Docker/Dockerfile.test b/virtualization/Docker/Dockerfile.test new file mode 100644 index 00000000000..6b9730bd8f4 --- /dev/null +++ b/virtualization/Docker/Dockerfile.test @@ -0,0 +1,32 @@ +FROM python:3.4 +MAINTAINER Paulus Schoutsen + +VOLUME /config + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +RUN pip3 install --no-cache-dir colorlog cython + +# For the nmap tracker, bluetooth tracker, Z-Wave +RUN apt-get update && \ + apt-get install -y --no-install-recommends nmap net-tools cython3 libudev-dev sudo libglib2.0-dev locales-all && \ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN pip3 install --no-cache-dir tox + +# Copy over everything required to run tox +COPY requirements_all.txt requirements_all.txt +COPY requirements_test.txt requirements_test.txt +COPY setup.cfg setup.cfg +COPY setup.py setup.py +COPY tox.ini tox.ini +COPY homeassistant/const.py homeassistant/const.py + +# Get deps +RUN tox --notest + +# Copy source and run tests +COPY . . + +CMD [ "tox" ]