Add Travis CI

This commit is contained in:
Ben Firshman 2014-01-06 10:12:37 +00:00
parent d8a2a0f003
commit 17b9cc430c
2 changed files with 31 additions and 3 deletions

View File

@ -2,10 +2,20 @@ language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
install:
- sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
- sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
- sudo apt-get update
- echo exit 101 | sudo tee /usr/sbin/policy-rc.d
- sudo chmod +x /usr/sbin/policy-rc.d
- sudo apt-get install -qy slirp lxc lxc-docker=0.7.3
- git clone git://github.com/jpetazzo/sekexe
- python setup.py install
- pip install nose==1.3.0
script: nosetests
script:
- pwd
- env
- sekexe/run "`pwd`/script/travis $TRAVIS_PYTHON_VERSION"

18
script/travis Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Exit on first error
set -e
TRAVIS_PYTHON_VERSION=$1
source /home/travis/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/activate
env
# Kill background processes on exit
trap 'kill $(jobs -p)' SIGINT SIGTERM EXIT
# Start docker daemon
docker -d -H 0.0.0.0:4243 -H unix:///var/run/docker.sock 2>> /dev/null >> /dev/null &
sleep 2
# $init is set by sekexe
cd $(dirname $init)/.. && nosetests