Commit c741d3585df1c35ff52c4da2a8779e36d36057e1
1 parent
83dc32cc
Exists in
test
Added makefile
Showing
4 changed files
with
52 additions
and
29 deletions
Show diff stats
.travis.yml
| 1 | language: python | 1 | language: python |
| 2 | 2 | ||
| 3 | -cache: apt | ||
| 4 | - | ||
| 5 | python: | 3 | python: |
| 6 | - "2.7" | 4 | - "2.7" |
| 7 | 5 | ||
| 8 | -env: | ||
| 9 | - global: | ||
| 10 | - - DJANGO_SETTINGS_MODULE=tests.settings | ||
| 11 | - - COLAB_SETTINGS=tests/settings.yaml | ||
| 12 | - | ||
| 13 | install: | 6 | install: |
| 14 | - - pip install coveralls flake8 | ||
| 15 | - - pip install . | ||
| 16 | - - psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres | ||
| 17 | - | ||
| 18 | -before_script: | ||
| 19 | - - colab-admin build_solr_schema > /tmp/schema.xml | ||
| 20 | - - cat ci/install_solr.sh | SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" bash | 7 | + - make travis_install |
| 21 | 8 | ||
| 22 | script: | 9 | script: |
| 23 | - - python setup.py test | ||
| 24 | - - flake8 colab | 10 | + - make test |
| 25 | 11 | ||
| 26 | after_success: | 12 | after_success: |
| 27 | - - coveralls | ||
| 28 | - - ci/build_rpm.sh | 13 | + - make coveralls |
| 14 | + - make rpm |
| @@ -0,0 +1,48 @@ | @@ -0,0 +1,48 @@ | ||
| 1 | + | ||
| 2 | +VIRTUALENV_PATH = /tmp/colab-venv | ||
| 3 | +PATH := $(VIRTUALENV_PATH)/bin:${PATH} | ||
| 4 | + | ||
| 5 | +DJANGO_SETTINGS_MODULE = tests.settings | ||
| 6 | +export DJANGO_SETTINGS_MODULE | ||
| 7 | +COLAB_SETTINGS = tests/settings.yaml | ||
| 8 | +export COLAB_SETTINGS | ||
| 9 | + | ||
| 10 | +ifndef RELEASE | ||
| 11 | + RELEASE = 1 | ||
| 12 | +endif | ||
| 13 | + | ||
| 14 | +all: | ||
| 15 | + echo $(RELEASE) | ||
| 16 | + | ||
| 17 | +install: | ||
| 18 | + virtualenv $(VIRTUALENV_PATH) | ||
| 19 | + pip install . | ||
| 20 | + virtualenv --relocatable $(VIRTUALENV_PATH) | ||
| 21 | + | ||
| 22 | +test_install: install_solr | ||
| 23 | + pip install flake8 | ||
| 24 | + | ||
| 25 | +install_solr: | ||
| 26 | + # Install java | ||
| 27 | + which apt-get && sudo apt-get install default-jre -y || echo # deb | ||
| 28 | + which yum && sudo yum install java -y || echo # rpm | ||
| 29 | + | ||
| 30 | + colab-admin build_solr_schema > /tmp/schema.xml | ||
| 31 | + SOLR_VERSION=4.10.3 SOLR_CONFS="/tmp/schema.xml" ci/install_solr.sh | ||
| 32 | + | ||
| 33 | +travis_install: test_install | ||
| 34 | + psql -c "CREATE USER colab WITH PASSWORD 'colab' CREATEDB;" -U postgres | ||
| 35 | + | ||
| 36 | +test: | ||
| 37 | + python setup.py test | ||
| 38 | + flake8 colab | ||
| 39 | + | ||
| 40 | +coveralls: | ||
| 41 | + pip install coveralls | ||
| 42 | + coveralls | ||
| 43 | + | ||
| 44 | +rpm: | ||
| 45 | + ci/build_rpm.sh | ||
| 46 | + | ||
| 47 | +clean: | ||
| 48 | + $(RM) -r $(VIRTUALENV_PATH) |
setup.py
tests/settings.py