From ad96e10938d98cefbbbe1a17774802f36f8b8ad8 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 6 Oct 2015 16:32:59 -0400 Subject: [PATCH] Add travis.yml for building binaries. Signed-off-by: Daniel Nephin --- .travis.yml | 19 +++++++++++++++++++ script/build-osx | 1 - script/prepare-osx | 2 +- script/travis/build-binary | 11 +++++++++++ script/travis/ci | 10 ++++++++++ script/travis/install | 9 +++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .travis.yml create mode 100755 script/travis/build-binary create mode 100755 script/travis/ci create mode 100755 script/travis/install diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..0f966f9da --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required + +language: python + +services: + - docker + +matrix: + include: + - os: linux + - os: osx + language: generic + + +install: ./script/travis/install + +script: + - ./script/travis/ci + - ./script/travis/build-binary diff --git a/script/build-osx b/script/build-osx index 15a7bbc54..042964e4b 100755 --- a/script/build-osx +++ b/script/build-osx @@ -3,7 +3,6 @@ set -ex PATH="/usr/local/bin:$PATH" -./script/clean rm -rf venv virtualenv -p /usr/local/bin/python venv diff --git a/script/prepare-osx b/script/prepare-osx index ca2776b64..10bbbecc3 100755 --- a/script/prepare-osx +++ b/script/prepare-osx @@ -24,7 +24,7 @@ if !(which brew); then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi -brew update +brew update > /dev/null if !(python_version | grep "$desired_python_version"); then if brew list | grep python; then diff --git a/script/travis/build-binary b/script/travis/build-binary new file mode 100755 index 000000000..b3b7b925b --- /dev/null +++ b/script/travis/build-binary @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + script/build-linux + # TODO: add script/build-image +else + script/prepare-osx + script/build-osx +fi diff --git a/script/travis/ci b/script/travis/ci new file mode 100755 index 000000000..4cce1bc84 --- /dev/null +++ b/script/travis/ci @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + tox -e py27,py34 -- tests/unit +else + # TODO: we could also install py34 and test against it + python -m tox -e py27 -- tests/unit +fi diff --git a/script/travis/install b/script/travis/install new file mode 100755 index 000000000..a23667bff --- /dev/null +++ b/script/travis/install @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + pip install tox==2.1.1 +else + pip install --user tox==2.1.1 +fi