Export GOOS and GOARCH in subprocess for tgz

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-03-22 14:12:29 -07:00
parent aca7e73a69
commit 5ff66748da
4 changed files with 12 additions and 8 deletions

View File

@ -302,10 +302,12 @@ copy_containerd() {
cp /usr/local/bin/ctr "$dir/"
cp /usr/local/bin/containerd "$dir/"
cp /usr/local/bin/containerd-shim "$dir/"
hash_files "$dir/runc"
hash_files "$dir/ctr"
hash_files "$dir/containerd"
hash_files "$dir/containerd-shim"
if [ "$2" == "hash" ]; then
hash_files "$dir/runc"
hash_files "$dir/ctr"
hash_files "$dir/containerd"
hash_files "$dir/containerd-shim"
fi
fi
)
fi

View File

@ -61,5 +61,5 @@ go build \
echo "Created binary: $DEST/$BINARY_FULLNAME"
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
copy_containerd "$DEST"
copy_containerd "$DEST" "hash"
hash_files "$DEST/$BINARY_FULLNAME"

View File

@ -26,5 +26,5 @@ go build -compiler=gccgo \
echo "Created binary: $DEST/$BINARY_FULLNAME"
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"
copy_containerd "$DEST"
copy_containerd "$DEST" "hash"
hash_files "$DEST/$BINARY_FULLNAME"

View File

@ -9,9 +9,10 @@ if [ ! -d "$CROSS/linux/amd64" ]; then
false
fi
(
for d in "$CROSS/"*/*; do
GOARCH="$(basename "$d")"
GOOS="$(basename "$(dirname "$d")")"
export GOARCH="$(basename "$d")"
export GOOS="$(basename "$(dirname "$d")")"
BINARY_NAME="docker-$VERSION"
BINARY_EXTENSION="$(export GOOS && binary_extension)"
BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
@ -32,3 +33,4 @@ for d in "$CROSS/"*/*; do
echo "Created tgz: $TGZ"
done
)