Merge "tests: Add travis configuration"

This commit is contained in:
Jenkins 2017-04-13 17:07:50 +00:00 committed by Gerrit Code Review
commit e2beeab11b
3 changed files with 82 additions and 0 deletions

44
.travis.yml Normal file
View File

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

View File

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

View File

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