Update traefik dependencies (docker/docker and related) (#1823)

Update traefik dependencies (docker/docker and related)

- Update dependencies
- Fix compilation problems
- Remove vdemeester/docker-events (in docker api now)
- Remove `integration/vendor`
- Use `testImport`
- update some deps.
- regenerate the lock from scratch (after a `glide cc`)
This commit is contained in:
Vincent Demeester 2017-07-06 16:28:13 +02:00 committed by Ludovic Fernandez
parent 7d178f49b4
commit b7daa2f3a4
1301 changed files with 21476 additions and 150099 deletions

View file

@ -1,47 +1,5 @@
#!/usr/bin/env bash
set -e
if ! test -e autogen/gen.go; then
echo >&2 'error: generate must be run before crossbinary'
false
fi
if [ -z "$VERSION" ]; then
VERSION=$(git rev-parse HEAD)
fi
if [ -z "$CODENAME" ]; then
CODENAME=cheddar
fi
if [ -z "$DATE" ]; then
DATE=$(date -u '+%Y-%m-%d_%I:%M:%S%p')
fi
GIT_REPO_URL='github.com/containous/traefik/version'
GO_BUILD_CMD="go build -ldflags"
GO_BUILD_OPT="-s -w -X ${GIT_REPO_URL}.Version=$VERSION -X ${GIT_REPO_URL}.Codename=$CODENAME -X ${GIT_REPO_URL}.BuildDate=$DATE"
# Get rid of existing binaries
rm -f dist/traefik_*
# Build 386 amd64 binaries
OS_PLATFORM_ARG=(linux darwin windows freebsd openbsd)
OS_ARCH_ARG=(386 amd64)
for OS in ${OS_PLATFORM_ARG[@]}; do
for ARCH in ${OS_ARCH_ARG[@]}; do
echo "Building binary for $OS/$ARCH..."
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 $GO_BUILD_CMD "$GO_BUILD_OPT" -o "dist/traefik_$OS-$ARCH" ./cmd/traefik/
done
done
# Build arm binaries
OS_PLATFORM_ARG=(linux)
OS_ARCH_ARG=(arm arm64)
for OS in ${OS_PLATFORM_ARG[@]}; do
for ARCH in ${OS_ARCH_ARG[@]}; do
echo "Building binary for $OS/$ARCH..."
GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 $GO_BUILD_CMD "$GO_BUILD_OPT" -o "dist/traefik_$OS-$ARCH" ./cmd/traefik/
done
done
./script/crossbinary-default
./script/crossbinary-others

View file

@ -32,7 +32,6 @@ for OS in ${OS_PLATFORM_ARG[@]}; do
done
done
# Build arm64 binaries
OS_PLATFORM_ARG=(linux)
OS_ARCH_ARG=(arm64)

View file

@ -6,13 +6,7 @@ set -o nounset
####
### Helper script for glide[-vc] to handle specifics for the Traefik repo.
##
# In particular, the 'integration/' directory contains its own set of
# glide-managed dependencies which must not have its nested vendor folder
# stripped. Depending on where the script is called from, it will do the Right
# Thing.
#
CWD="$(pwd)"; readonly CWD
GLIDE_ARGS=()
GLIDE_VC_ARGS=(
'--use-lock-file' # `glide list` seems to miss test dependencies, e.g., github.com/mattn/go-shellwords
@ -20,6 +14,10 @@ GLIDE_VC_ARGS=(
'--no-tests'
)
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
readonly SCRIPT_DIR
readonly GLIDE_DIR="${SCRIPT_DIR}/.."
usage() {
echo "usage: $(basename "$0") install | update | get <package> | trim
install: Install all dependencies and trim the vendor folder afterwards (alternative command: i).
@ -30,14 +28,7 @@ trim: Trim the vendor folder only, do not install or update dependencies.
The current working directory must contain a glide.yaml file." >&2
}
is_integration_dir() {
[[ "$(basename ${CWD})" = 'integration' ]]
}
GLIDE_ARGS+=('--strip-vendor')
if ! is_integration_dir; then
GLIDE_ARGS+=('--skip-test')
fi
if ! type glide > /dev/null 2>&1; then
echo "glide not found in PATH." >&2
@ -49,7 +40,7 @@ if ! type glide-vc > /dev/null 2>&1; then
exit 1
fi
if [[ ! -e "${CWD}/glide.yaml" ]]; then
if [[ ! -e "${GLIDE_DIR}/glide.yaml" ]]; then
echo "no glide.yaml file found in the current working directory" >&2
exit 1
fi

View file

@ -6,32 +6,28 @@ set -o nounset
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; export SCRIPTDIR
source "${SCRIPTDIR}/.validate"
# Iterate over all directories containing vendor folders.
for dir in . integration; do
vendor_dir="${dir}/vendor/"
IFS=$'\n' files=( $(validate_diff --diff-filter=ACMR --name-only -- ${vendor_dir} || true) )
vendor_dir="./vendor/"
IFS=$'\n' files=( $(validate_diff --diff-filter=ACMR --name-only -- ${vendor_dir} || true) )
if [[ ${#files[@]} -gt 0 ]]; then
# We run glide install to and see if we have a diff afterwards
echo "checking ${vendor_dir} for unintentional changes..."
(
cd ${dir}
"${SCRIPTDIR}/glide.sh" install
)
# Let see if the working directory is clean
diffs="$(git status --porcelain -- ${vendor_dir} 2>/dev/null)"
if [[ "$diffs" ]]; then
{
echo "The result of 'glide install' for vendor directory '${dir}' differs"
echo
echo "$diffs"
echo
echo 'Please vendor your package(s) with script/glide.sh.'
echo
} >&2
exit 2
fi
fi
done
if [[ ${#files[@]} -gt 0 ]]; then
# We run glide install to and see if we have a diff afterwards
echo "checking ${vendor_dir} for unintentional changes..."
(
"${SCRIPTDIR}/glide.sh" install
)
# Let see if the working directory is clean
diffs="$(git status --porcelain -- ${vendor_dir} 2>/dev/null)"
if [[ "$diffs" ]]; then
{
echo "The result of 'glide install' for vendor directory '${vendor_dir}' differs"
echo
echo "$diffs"
echo
echo 'Please vendor your package(s) with script/glide.sh.'
echo
} >&2
exit 2
fi
fi
echo 'Congratulations! All vendoring changes are done the right way.'