1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

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 <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 3fb1fc0b7b225295b3059cb9a2f5fd9af7a73f36
Component: engine
This commit is contained in:
Tianon Gravi
2014-03-20 16:46:55 -06:00
committed by unclejack
parent 624997be0f
commit 466e144973
2 changed files with 8 additions and 16 deletions

View File

@@ -11,5 +11,6 @@ go build \
" \
./docker
echo "Created binary: $DEST/docker-$VERSION"
ln -sf "docker-$VERSION" "$DEST/docker"
hash_files "$DEST/docker-$VERSION"

View File

@@ -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
)