summaryrefslogtreecommitdiff
path: root/hack/make
diff options
context:
space:
mode:
Diffstat (limited to 'hack/make')
-rwxr-xr-x[-rw-r--r--]hack/make/binary5
-rw-r--r--hack/make/dynbinary6
-rw-r--r--hack/make/test-integration-cli40
-rw-r--r--hack/make/tgz2
-rw-r--r--hack/make/ubuntu8
5 files changed, 58 insertions, 3 deletions
diff --git a/hack/make/binary b/hack/make/binary
index 7272b1ede0..041e4d1ee8 100644..100755
--- a/hack/make/binary
+++ b/hack/make/binary
@@ -3,7 +3,7 @@
DEST=$1
go build \
- -o $DEST/docker-$VERSION \
+ -o "$DEST/docker-$VERSION" \
"${BUILDFLAGS[@]}" \
-ldflags "
$LDFLAGS
@@ -11,3 +11,6 @@ go build \
" \
./docker
echo "Created binary: $DEST/docker-$VERSION"
+ln -sf "docker-$VERSION" "$DEST/docker"
+
+hash_files "$DEST/docker-$VERSION"
diff --git a/hack/make/dynbinary b/hack/make/dynbinary
index d4f583fb62..75cffe3dcc 100644
--- a/hack/make/dynbinary
+++ b/hack/make/dynbinary
@@ -5,7 +5,7 @@ DEST=$1
if [ -z "$DOCKER_CLIENTONLY" ]; then
# dockerinit still needs to be a static binary, even if docker is dynamic
go build \
- -o $DEST/dockerinit-$VERSION \
+ -o "$DEST/dockerinit-$VERSION" \
"${BUILDFLAGS[@]}" \
-ldflags "
$LDFLAGS
@@ -14,7 +14,9 @@ if [ -z "$DOCKER_CLIENTONLY" ]; then
" \
./dockerinit
echo "Created binary: $DEST/dockerinit-$VERSION"
- ln -sf dockerinit-$VERSION $DEST/dockerinit
+ ln -sf "dockerinit-$VERSION" "$DEST/dockerinit"
+
+ hash_files "$DEST/dockerinit-$VERSION"
sha1sum=
if command -v sha1sum &> /dev/null; then
diff --git a/hack/make/test-integration-cli b/hack/make/test-integration-cli
new file mode 100644
index 0000000000..b0506d261a
--- /dev/null
+++ b/hack/make/test-integration-cli
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+DEST=$1
+
+set -e
+
+DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
+DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}
+
+bundle_test_integration_cli() {
+ go_test_dir ./integration-cli
+}
+
+# subshell so that we can export PATH without breaking other things
+(
+ export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH"
+
+ if ! command -v docker &> /dev/null; then
+ echo >&2 'error: binary or dynbinary must be run before test-integration-cli'
+ false
+ fi
+
+ ( set -x; exec \
+ docker --daemon --debug \
+ --storage-driver "$DOCKER_GRAPHDRIVER" \
+ --exec-driver "$DOCKER_EXECDRIVER" \
+ --pidfile "$DEST/docker.pid" \
+ &> "$DEST/docker.log"
+ ) &
+
+ # pull the busybox image before running the tests
+ sleep 2
+ ( set -x; docker pull busybox )
+
+ bundle_test_integration_cli
+
+ DOCKERD_PID=$(set -x; cat $DEST/docker.pid)
+ ( set -x; kill $DOCKERD_PID )
+ wait $DOCKERD_PID || true
+) 2>&1 | tee $DEST/test.log
diff --git a/hack/make/tgz b/hack/make/tgz
index 5d03306322..120339976b 100644
--- a/hack/make/tgz
+++ b/hack/make/tgz
@@ -23,6 +23,8 @@ for d in "$CROSS/"*/*; do
tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
+ hash_files "$TGZ"
+
rm -rf "$DEST/build"
echo "Created tgz: $TGZ"
diff --git a/hack/make/ubuntu b/hack/make/ubuntu
index ebc12f27ec..403a6c7652 100644
--- a/hack/make/ubuntu
+++ b/hack/make/ubuntu
@@ -38,6 +38,14 @@ bundle_ubuntu() {
mkdir -p $DIR/lib/systemd/system
cp contrib/init/systemd/docker.service $DIR/lib/systemd/system/
+ # Include contributed completions
+ mkdir -p $DIR/etc/bash_completion.d
+ cp contrib/completion/bash/docker $DIR/etc/bash_completion.d/
+ mkdir -p $DIR/usr/share/zsh/vendor-completions
+ cp contrib/completion/zsh/_docker $DIR/usr/share/zsh/vendor-completions/
+ mkdir -p $DIR/etc/fish/completions
+ cp contrib/completion/fish/docker.fish $DIR/etc/fish/completions/
+
# Copy the binary
# This will fail if the binary bundle hasn't been built
mkdir -p $DIR/usr/bin