Browse code

Unify dyntest/test and dynbinary/binary hack bundlescripts further by cross-invocation and keeping all the logic in one place, taking advantage of LDFLAGS_STATIC that is the only bit that gets replaced for dyntest/dynbinary

Tianon Gravi authored on 2013/12/09 10:40:05
Showing 2 changed files
... ...
@@ -11,5 +11,7 @@ ln -sf dockerinit-$VERSION $DEST/dockerinit
11 11
 export DOCKER_INITSHA1="$(sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)"
12 12
 # exported so that "dyntest" can easily access it later without recalculating it
13 13
 
14
-go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS -X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" $BUILDFLAGS ./docker
15
-echo "Created binary: $DEST/docker-$VERSION"
14
+(
15
+	export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\""
16
+	source "$(dirname "$BASH_SOURCE")/binary"
17
+)
... ...
@@ -10,7 +10,8 @@ if [ ! -x "$INIT" ]; then
10 10
 	false
11 11
 fi
12 12
 
13
-export TEST_DOCKERINIT_PATH="$INIT"
14
-
15
-LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" \
13
+(
14
+	export TEST_DOCKERINIT_PATH="$INIT"
15
+	export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\""
16 16
 	source "$(dirname "$BASH_SOURCE")/test"
17
+)