diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..72b03e19 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +language: python +sudo: required + +services: + - docker + +cache: + directories: + - ~/.cache/pip +env: + - TARGET: bashate + - TARGET: pep8 + - TARGET: docs + - TARGET: docs-gnocchi.xyz + + - TARGET: py27-mysql-ceph-upgrade-from-3.1 + - TARGET: py35-postgresql-file-upgrade-from-3.1 + + - TARGET: py27-mysql + - TARGET: py35-mysql + - TARGET: py27-postgresql + - TARGET: py35-postgresql + +before_script: +# Travis We need to fetch all tags/branches for documentation target + - case $TARGET in + docs*) + git fetch origin $(git ls-remote -q | sed -n '/refs\/heads/s,.*refs/heads\(.*\),:remotes/origin\1,gp') ; + git fetch --tags ; + git fetch --unshallow ; + ;; + esac + + - docker build --tag gnocchi-ci --file=tools/travis-ci-setup.dockerfile . +script: + - docker run -v ~/.cache/pip:/home/tester/.cache/pip -v $(pwd):/home/tester/src gnocchi-ci tox -e ${TARGET} + +notifications: + email: false + irc: + on_success: change + on_failure: always + channels: + - "irc.freenode.org#gnocchi" diff --git a/tools/travis-ci-setup.dockerfile b/tools/travis-ci-setup.dockerfile new file mode 100644 index 00000000..784c14c8 --- /dev/null +++ b/tools/travis-ci-setup.dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:16.04 +ENV GNOCCHI_SRC /home/tester/src +ENV DEBIAN_FRONTEND noninteractive + +#NOTE(sileht): really no utf-8 in 2017 !? +ENV LANG en_US.UTF-8 +RUN update-locale +RUN locale-gen $LANG + +RUN apt-get update -y && apt-get install -qy \ + git \ + wget \ + nodejs \ + nodejs-legacy \ + npm \ + python \ + python3 \ + python-dev \ + python3-dev \ + python-tox \ + redis-server \ + build-essential \ + libffi-dev \ + libpq-dev \ + postgresql \ + mysql-client \ + mysql-server \ + librados-dev \ + ceph \ + && apt-get clean -y + +RUN useradd -ms /bin/bash tester +RUN mkdir $GNOCCHI_SRC +RUN chown -R tester: $GNOCCHI_SRC +USER tester +WORKDIR $GNOCCHI_SRC diff --git a/tox.ini b/tox.ini index d7af9206..9518c349 100644 --- a/tox.ini +++ b/tox.ini @@ -116,6 +116,7 @@ deps = .[mysql,postgresql,test,file,ceph,swift,s3] commands = gnocchi-config-generator [testenv:docs] +basepython = python2.7 # This does not work, see: https://bitbucket.org/hpk42/tox/issues/302 # deps = {[testenv]deps} # .[doc] @@ -126,6 +127,7 @@ commands = doc8 --ignore-path doc/source/rest.rst doc/source pifpaf -g GNOCCHI_INDEXER_URL run postgresql -- python setup.py build_sphinx [testenv:docs-gnocchi.xyz] +basepython = python2.7 deps = .[file,postgresql,test,doc] sphinx_rtd_theme sphinxcontrib-versioning