Speeds up lint and test in docker by keeping the cache between invocations. (#5177)
* Add a volume to store the tox cache on the host. This gives quite some speed boost when running lint_docker and test_docker. * Only map .tox directory for cache.
This commit is contained in:
parent
74aa8194d7
commit
cb85128304
4 changed files with 18 additions and 4 deletions
|
@ -1,6 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Execute lint to spot code mistakes.
|
# Execute lint to spot code mistakes.
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
if [ "$1" = "--changed" ]; then
|
if [ "$1" = "--changed" ]; then
|
||||||
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
|
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
|
||||||
echo "================================================="
|
echo "================================================="
|
||||||
|
|
|
@ -4,5 +4,10 @@
|
||||||
# Stop on errors
|
# Stop on errors
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
|
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
|
||||||
docker run --rm -it home-assistant-test tox -e lint
|
docker run --rm \
|
||||||
|
-v `pwd`/.tox/:/usr/src/app/.tox/ \
|
||||||
|
-t -i home-assistant-test \
|
||||||
|
tox -e lint
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Excutes the tests with tox.
|
# Executes the tests with tox.
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
tox -e py34
|
tox -e py34
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Excutes the tests with tox in a docker container.
|
# Executes the tests with tox in a docker container.
|
||||||
|
|
||||||
# Stop on errors
|
# Stop on errors
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
|
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
|
||||||
docker run --rm -it home-assistant-test tox -e py35
|
docker run --rm \
|
||||||
|
-v `pwd`/.tox/:/usr/src/app/.tox/ \
|
||||||
|
-t -i home-assistant-test \
|
||||||
|
tox -e py35
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue