1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix more instances of "dotcloud/docker" in hack/ (and add a DOCKER_PKG environment variable to simplify references to our "package path" in our bundlescripts)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
This commit is contained in:
Tianon Gravi 2014-07-30 17:02:04 -06:00
parent 19c8e74fd3
commit 3a14eb066c
6 changed files with 15 additions and 13 deletions

View file

@ -23,9 +23,11 @@ set -e
set -o pipefail set -o pipefail
export DOCKER_PKG='github.com/docker/docker'
# We're a nice, sexy, little shell script, and people might try to run us; # We're a nice, sexy, little shell script, and people might try to run us;
# but really, they shouldn't. We want to be in a container! # but really, they shouldn't. We want to be in a container!
if [ "$(pwd)" != '/go/src/github.com/docker/docker' ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then if [ "$(pwd)" != "/go/src/$DOCKER_PKG" ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then
{ {
echo "# WARNING! I don't seem to be running in the Docker container." echo "# WARNING! I don't seem to be running in the Docker container."
echo "# The result of this command might be an incorrect build, and will not be" echo "# The result of this command might be an incorrect build, and will not be"
@ -77,8 +79,8 @@ fi
if [ "$AUTO_GOPATH" ]; then if [ "$AUTO_GOPATH" ]; then
rm -rf .gopath rm -rf .gopath
mkdir -p .gopath/src/github.com/docker mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
ln -sf ../../../.. .gopath/src/github.com/docker/docker ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
export GOPATH="$(pwd)/.gopath:$(pwd)/vendor" export GOPATH="$(pwd)/.gopath:$(pwd)/vendor"
fi fi
@ -91,8 +93,8 @@ fi
# Use these flags when compiling the tests and final binary # Use these flags when compiling the tests and final binary
LDFLAGS=' LDFLAGS='
-w -w
-X github.com/docker/docker/dockerversion.GITCOMMIT "'$GITCOMMIT'" -X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'"
-X github.com/docker/docker/dockerversion.VERSION "'$VERSION'" -X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'"
' '
LDFLAGS_STATIC='-linkmode external' LDFLAGS_STATIC='-linkmode external'
EXTLDFLAGS_STATIC='-static' EXTLDFLAGS_STATIC='-static'
@ -103,7 +105,7 @@ BUILDFLAGS=( -a -tags "netgo static_build $DOCKER_BUILDTAGS" )
EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files" EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files"
LDFLAGS_STATIC_DOCKER=" LDFLAGS_STATIC_DOCKER="
$LDFLAGS_STATIC $LDFLAGS_STATIC
-X github.com/docker/docker/dockerversion.IAMSTATIC true -X $DOCKER_PKG/dockerversion.IAMSTATIC true
-extldflags \"$EXTLDFLAGS_STATIC_DOCKER\" -extldflags \"$EXTLDFLAGS_STATIC_DOCKER\"
" "
@ -150,7 +152,7 @@ go_test_dir() {
testcover=( -cover -coverprofile "$coverprofile" $coverpkg ) testcover=( -cover -coverprofile "$coverprofile" $coverpkg )
fi fi
( (
echo '+ go test' $TESTFLAGS "github.com/docker/docker${dir#.}" echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}"
cd "$dir" cd "$dir"
go test ${testcover[@]} -ldflags "$LDFLAGS" "${BUILDFLAGS[@]}" $TESTFLAGS go test ${testcover[@]} -ldflags "$LDFLAGS" "${BUILDFLAGS[@]}" $TESTFLAGS
) )
@ -178,7 +180,7 @@ go_compile_test_dir() {
[ $? -ne 0 ] && return 1 [ $? -ne 0 ] && return 1
mkdir -p "$(dirname "$out_file")" mkdir -p "$(dirname "$out_file")"
mv "$dir/$(basename "$dir").test" "$out_file" mv "$dir/$(basename "$dir").test" "$out_file"
echo "Precompiled: github.com/dotcloud/docker${dir#.}" echo "Precompiled: ${DOCKER_PKG}${dir#.}"
} }
# This helper function walks the current directory looking for directories # This helper function walks the current directory looking for directories

View file

@ -39,7 +39,7 @@ fi
# exported so that "dyntest" can easily access it later without recalculating it # exported so that "dyntest" can easily access it later without recalculating it
( (
export LDFLAGS_STATIC_DOCKER="-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/docker/docker/dockerversion.INITPATH \"$DOCKER_INITPATH\"" export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
source "$(dirname "$BASH_SOURCE")/binary" source "$(dirname "$BASH_SOURCE")/binary"
) )

View file

@ -12,7 +12,7 @@ fi
( (
export TEST_DOCKERINIT_PATH="$INIT" export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER=" export LDFLAGS_STATIC_DOCKER="
-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
" "
source "$(dirname "$BASH_SOURCE")/test-integration" source "$(dirname "$BASH_SOURCE")/test-integration"
) )

View file

@ -12,7 +12,7 @@ fi
( (
export TEST_DOCKERINIT_PATH="$INIT" export TEST_DOCKERINIT_PATH="$INIT"
export LDFLAGS_STATIC_DOCKER=" export LDFLAGS_STATIC_DOCKER="
-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\"
" "
source "$(dirname "$BASH_SOURCE")/test-unit" source "$(dirname "$BASH_SOURCE")/test-unit"
) )

View file

@ -5,7 +5,7 @@ DEST=$1
bundle_test_integration() { bundle_test_integration() {
LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir ./integration \ LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir ./integration \
"-coverpkg $(find_dirs '*.go' | sed 's,^\.,github.com/docker/docker,g' | paste -d, -s)" "-coverpkg $(find_dirs '*.go' | sed 's,^\.,'$DOCKER_PKG',g' | paste -d, -s)"
} }
# this "grep" hides some really irritating warnings that "go test -coverpkg" # this "grep" hides some really irritating warnings that "go test -coverpkg"

View file

@ -54,7 +54,7 @@ go_run_test_dir() {
TESTS_FAILED=() TESTS_FAILED=()
while read dir; do while read dir; do
echo echo
echo '+ go test' $TESTFLAGS "github.com/dotcloud/docker${dir#.}" echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}"
precompiled="$DEST/precompiled/$dir.test" precompiled="$DEST/precompiled/$dir.test"
if ! ( cd "$dir" && "$precompiled" ); then if ! ( cd "$dir" && "$precompiled" ); then
TESTS_FAILED+=("$dir") TESTS_FAILED+=("$dir")