1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/make/cross
Arnaud Porterie (icecrime) 32915b1d0a Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.

To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-05 12:14:29 -07:00

46 lines
1.2 KiB
Bash

#!/usr/bin/env bash
set -e
# explicit list of os/arch combos that support being a daemon
declare -A daemonSupporting
daemonSupporting=(
[linux/amd64]=1
[windows/amd64]=1
)
# if we have our linux/amd64 version compiled, let's symlink it in
if [ -x "$DEST/../binary-daemon/dockerd-$VERSION" ]; then
arch=$(go env GOHOSTARCH)
mkdir -p "$DEST/linux/${arch}"
(
cd "$DEST/linux/${arch}"
ln -s ../../../binary-daemon/* ./
)
echo "Created symlinks:" "$DEST/linux/${arch}/"*
fi
for platform in $DOCKER_CROSSPLATFORMS; do
(
export KEEPDEST=1
export DEST="$DEST/$platform" # bundles/VERSION/cross/GOOS/GOARCH/docker-VERSION
export GOOS=${platform%/*}
export GOARCH=${platform##*/}
if [ "$GOOS" != "solaris" ]; then
# TODO. Solaris cannot be cross build because of CGO calls.
# go install docker/docker/pkg packages to ensure that
# they build cross platform.
go install github.com/docker/docker/pkg/...
if [ -n "${daemonSupporting[$platform]}" ]; then
# Since tgz relies on the paths created by mkdir
# and we removed the clients, we don't want to mkdir
# for all the platforms, only the ones supported by the daemon.
mkdir -p "$DEST"
ABS_DEST="$(cd "$DEST" && pwd -P)"
source "${MAKEDIR}/binary-daemon"
fi
fi
)
done