Skip to content

Commit

Permalink
Merge pull request #674 from pgiraud/travis
Browse files Browse the repository at this point in the history
Using travis container-based infrastructure + use cache
  • Loading branch information
Pierre GIRAUD committed Jul 29, 2015
2 parents d0de8ec + faffb87 commit 5d8e3f9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
34 changes: 17 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ language: python
python:
- 2.7

cache:
directories:
- $HOME/.cache/pip
- $HOME/build/hotosm/osm-tasking-manager2/env

sudo: false

before_install:
- deactivate
- sudo add-apt-repository -y -r ppa:ubuntugis/ppa
- sudo apt-get update -qq
- sudo apt-get install postgresql-9.1-postgis

install:
- virtualenv env
- source env/bin/activate
- python setup.py develop
- sudo service postgresql restart
- sudo -u postgres createuser www-data --no-superuser --no-createdb --no-createrole
- sudo -u postgres createdb -O www-data osmtm
- sudo -u postgres psql -d osmtm -c "CREATE EXTENSION postgis;"
- sudo -u postgres createdb -O www-data osmtm_tests
- sudo -u postgres psql -d osmtm_tests -c "CREATE EXTENSION postgis;"
- easy_install flake8
- env/bin/pip install --upgrade pip
- env/bin/pip install -r requirements.txt
- createuser www-data --no-superuser --no-createdb --no-createrole -U postgres
- createdb -O www-data osmtm_tests -U postgres
- psql -d osmtm_tests -c "CREATE EXTENSION postgis;" -U postgres
- env/bin/pip install flake8

script:
- source env/bin/activate
- echo [app:main] >> local.test.ini
- echo sqlalchemy.url = postgresql://www-data:www-data@localhost/osmtm_tests >> local.test.ini
- nosetests
- flake8 osmtm --exclude=osmtm/static
- env/bin/nosetests
- env/bin/flake8 osmtm --exclude=osmtm/static

after_success:
- pip install coveralls
- coveralls
- env/bin/pip install coveralls
- env/bin/coveralls
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To create a virtual Python environment:
cd osm-tasking-manager2
sudo easy_install virtualenv
virtualenv --no-site-packages env
./env/bin/python setup.py develop
./env/bin/pip install -r requirements.txt

*Tip: if you encounter problems installing `psycopg2` especially on Mac, it is recommended to follow advice proposed [here](http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa).*

Expand Down Expand Up @@ -127,7 +127,7 @@ To run the tests, use the following command:

1. pull latest updates from the repository: `git pull origin`
1. update the submodules: `git submodule update`
1. update/install python modules: `./env/bin/python setup.py develop`
1. update/install python modules: `./env/bin/pip install -r requirements.txt`
1. create database dump: `pg_dump -Fc -f osmtm2_latest.dmp database_name`
1. run database migrations: `alembic upgrade head`
1. compile messages: `./env/bin/python setup.py compile_catalog`
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .

0 comments on commit 5d8e3f9

Please sign in to comment.