Ensure docker-proxy is installed in unit-test ci

(some) libnetwork tests require docker-proxy so we need to install that
in CI.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff 2021-04-28 20:08:11 +00:00
parent e837dd0fb8
commit 4da0dc974c
5 changed files with 35 additions and 16 deletions

8
Jenkinsfile vendored
View File

@ -190,7 +190,7 @@ pipeline {
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
hack/test/unit"
'''
}
post {
@ -587,7 +587,7 @@ pipeline {
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
hack/test/unit"
'''
}
post {
@ -786,7 +786,7 @@ pipeline {
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
hack/test/unit"
'''
}
post {
@ -982,7 +982,7 @@ pipeline {
-e VALIDATE_REPO=${GIT_URL} \
-e VALIDATE_BRANCH=${CHANGE_TARGET} \
docker:${GIT_COMMIT} \
hack/test/unit
hack/test/unit"
'''
}
post {

14
hack/make/.install Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
install_binary() {
local file="$1"
local target="${DOCKER_MAKE_INSTALL_PREFIX:=/usr/local}/bin/"
if [ "$(go env GOOS)" == "linux" ]; then
echo "Installing $(basename $file) to ${target}"
mkdir -p "$target"
cp -f -L "$file" "$target"
else
echo "Install is only supported on linux"
return 1
fi
}

View File

@ -3,18 +3,7 @@
set -e
rm -rf "$DEST"
install_binary() {
local file="$1"
local target="${DOCKER_MAKE_INSTALL_PREFIX:=/usr/local}/bin/"
if [ "$(go env GOOS)" == "linux" ]; then
echo "Installing $(basename $file) to ${target}"
mkdir -p "$target"
cp -f -L "$file" "$target"
else
echo "Install is only supported on linux"
return 1
fi
}
source "${MAKEDIR}/.install"
(
DEST="$(dirname $DEST)/binary-daemon"

11
hack/make/install-proxy Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
rm -rf "$DEST"
source "${MAKEDIR}/.install"
(
DEST="$(dirname $DEST)/binary-proxy"
install_binary "${DEST}/docker-proxy"
)

View File

@ -18,6 +18,11 @@ TESTDIRS="${TESTDIRS:-./...}"
exclude_paths='/vendor/|/integration'
pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
echo "${pkg_list}" | grep --fixed-strings "libnetwork/drivers/bridge" && \
if ! type docker-proxy; then
hack/make.sh binary-proxy install-proxy
fi
mkdir -p bundles
gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- \
"${BUILDFLAGS[@]}" \