1
0
Эх сурвалжийг харах

Fix script/test by just calling script/test-versions directly instead of launching another container.

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 10 жил өмнө
parent
commit
74782a56b5
3 өөрчлөгдсөн 10 нэмэгдсэн , 11 устгасан
  1. 1 0
      script/ci
  2. 5 10
      script/test
  3. 4 1
      script/test-versions

+ 1 - 0
script/ci

@@ -10,6 +10,7 @@ set -e
 
 export DOCKER_VERSIONS=all
 export DOCKER_DAEMON_ARGS="--storage-driver=overlay"
+GIT_VOLUME="--volumes-from=$(hostname)"
 . script/test-versions
 
 >&2 echo "Building Linux binary"

+ 5 - 10
script/test

@@ -6,15 +6,10 @@ set -ex
 TAG="docker-compose:$(git rev-parse --short HEAD)"
 
 rm -rf coverage-html
+# Create the host directory so it's owned by $USER
+mkdir -p coverage-html
 
 docker build -t "$TAG" .
-docker run \
-  --rm \
-  --volume="/var/run/docker.sock:/var/run/docker.sock" \
-  -e DOCKER_VERSIONS \
-  -e "TAG=$TAG" \
-  -e "affinity:image==$TAG" \
-  -e "COVERAGE_DIR=$(pwd)/coverage-html" \
-  --entrypoint="script/test-versions" \
-  "$TAG" \
-  "$@"
+
+GIT_VOLUME="--volume=$(pwd)/.git:/code/.git"
+. script/test-versions

+ 4 - 1
script/test-versions

@@ -5,7 +5,10 @@
 set -e
 
 >&2 echo "Running lint checks"
-tox -e pre-commit
+docker run --rm \
+  ${GIT_VOLUME} \
+  --entrypoint="tox" \
+  "$TAG" -e pre-commit
 
 if [ "$DOCKER_VERSIONS" == "" ]; then
   DOCKER_VERSIONS="default"