2013-10-10 20:46:09 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
COMMIT=${1-HEAD}
|
|
|
|
REPO=${2-http://github.com/dotcloud/docker}
|
|
|
|
BRANCH=${3-master}
|
|
|
|
|
|
|
|
# Compute test paths
|
2013-10-19 01:33:16 -04:00
|
|
|
DOCKER_PATH=/go/src/github.com/dotcloud/docker
|
2013-10-10 20:46:09 -04:00
|
|
|
|
|
|
|
# Fetch latest master
|
2013-10-19 01:33:16 -04:00
|
|
|
rm -rf /go
|
2013-10-10 20:46:09 -04:00
|
|
|
mkdir -p $DOCKER_PATH
|
|
|
|
cd $DOCKER_PATH
|
|
|
|
git init .
|
|
|
|
git fetch -q http://github.com/dotcloud/docker master
|
|
|
|
git reset --hard FETCH_HEAD
|
|
|
|
|
|
|
|
# Merge commit
|
2013-10-19 01:33:16 -04:00
|
|
|
#echo FIXME. Temporarily skip TestPrivilegedCanMount until DinD works reliable on AWS
|
|
|
|
git pull -q https://github.com/mzdaniel/docker.git dind-aws || exit 1
|
|
|
|
|
|
|
|
# Merge commit in top of master
|
2013-10-10 20:46:09 -04:00
|
|
|
git fetch -q "$REPO" "$BRANCH"
|
|
|
|
git merge --no-edit $COMMIT || exit 1
|
|
|
|
|
|
|
|
# Test commit
|
|
|
|
go test -v; exit_status=$?
|
|
|
|
|
2013-10-19 01:33:16 -04:00
|
|
|
# Display load if test fails
|
|
|
|
if [ $exit_status -eq 1 ] ; then
|
|
|
|
uptime; echo; free
|
|
|
|
fi
|
|
|
|
|
2013-10-10 20:46:09 -04:00
|
|
|
# Cleanup testing directory
|
|
|
|
rm -rf $BASE_PATH
|
|
|
|
|
|
|
|
exit $exit_status
|