tests: Add travis configuration
Change-Id: I93b6a598ffd424db89c4bf5374a61a361428de60
This commit is contained in:
parent
ba83880d48
commit
eb232de0e7
44
.travis.yml
Normal file
44
.travis.yml
Normal 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"
|
36
tools/travis-ci-setup.dockerfile
Normal file
36
tools/travis-ci-setup.dockerfile
Normal 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
|
2
tox.ini
2
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
|
||||
|
Loading…
Reference in New Issue
Block a user