From 3fb1fc0b7b225295b3059cb9a2f5fd9af7a73f36 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 20 Mar 2014 16:46:55 -0600 Subject: [PATCH] Small tweaks to the hack scripts to make them simpler Please do with this as you please (including rebasing and/or squashing it), especially under clause (c) of the DCO. Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- hack/make/binary | 1 + hack/make/test-integration-cli | 23 +++++++---------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/hack/make/binary b/hack/make/binary index 7b4d7b5b5b..041e4d1ee8 100755 --- a/hack/make/binary +++ b/hack/make/binary @@ -11,5 +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/test-integration-cli b/hack/make/test-integration-cli index 5ab37a4021..d007fbaf6a 100644 --- a/hack/make/test-integration-cli +++ b/hack/make/test-integration-cli @@ -1,37 +1,28 @@ #!/bin/bash DEST=$1 -DOCKERBIN=$DEST/../binary/docker-$VERSION -DYNDOCKERBIN=$DEST/../dynbinary/docker-$VERSION -DOCKERINITBIN=$DEST/../dynbinary/dockerinit-$VERSION set -e +# subshell so that we can export PATH without breaking other things +( +export PATH="$DEST/../binary:$DEST/../dynbinary:$PATH" + bundle_test_integration_cli() { go_test_dir ./integration-cli } -if [ -x "/usr/bin/docker" ]; then - echo "docker found at /usr/bin/docker" -elif [ -x "$DOCKERBIN" ]; then - ln -s $DOCKERBIN /usr/bin/docker -elif [ -x "$DYNDOCKERBIN" ]; then - ln -s $DYNDOCKERBIN /usr/bin/docker - ln -s $DOCKERINITBIN /usr/bin/dockerinit -else +if ! command -v docker &> /dev/null; then echo >&2 'error: binary or dynbinary must be run before test-integration-cli' false fi - docker -d -D -p $DEST/docker.pid &> $DEST/docker.log & -sleep 2 -docker info -DOCKERD_PID=`cat $DEST/docker.pid` bundle_test_integration_cli 2>&1 \ | tee $DEST/test.log +DOCKERD_PID=$(cat $DEST/docker.pid) kill $DOCKERD_PID wait $DOCKERD_PID - +)