Browse Source

Merge pull request #345 from interlegis/141-integracao-travis

fix #141 integracao travis
pull/437/head
Edward 9 years ago
parent
commit
415dfa425d
  1. 8
      .env_dev
  2. 47
      .travis.yml
  3. 5
      requirements/dev-requirements.txt
  4. 7
      requirements/requirements.txt
  5. 17
      requirements/test-requirements.txt

8
.env_dev

@ -0,0 +1,8 @@
DATABASE_URL = postgresql://postgres:@localhost:/sapl
SECRET_KEY=TravisTest
DEBUG=False
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST = 'smtp.interlegis.leg.br'
EMAIL_HOST_USER = 'sapl-test'
EMAIL_HOST_PASSWORD = '2BhCwbGHcZ'

47
.travis.yml

@ -1,4 +1,45 @@
language: python language: python
python: 3.4 sudo: required
install: "pip install -r requirements/dev-requirements.txt"
script: py.test python:
- "3.4.3"
services:
- postgresql
addons:
postgresql: "9.3"
install:
- sudo apt-get install git nginx python3-dev libpq-dev graphviz-dev graphviz pkg-config python-psycopg2 nodejs npm
- sudo ln -s /usr/bin/node
- pip install -r requirements/test-requirements.txt
- pip install --upgrade setuptools
# Line 24 to 35 is a hack found in this link below
# It was used to fix an error in database building
# https://dockyard.com/blog/ruby/2013/03/29/running-postgresql-9-2-on-travis-ci
before_script:
- sudo /etc/init.d/postgresql stop
- sudo cp /etc/postgresql/9.2/main/pg_hba.conf ./
- sudo apt-get remove postgresql postgresql-9.2 -qq --purge
- source /etc/lsb-release
- echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main" > pgdg.list
- sudo mv pgdg.list /etc/apt/sources.list.d/
- wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
- sudo apt-get update
- sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install postgresql-9.3 postgresql-contrib-9.3 -qq
- sudo /etc/init.d/postgresql stop
- sudo cp ./pg_hba.conf /etc/postgresql/9.3/main
- sudo /etc/init.d/postgresql start
- npm install -g bower
- cp .env_dev .env
- sed -i -e 's/getpass.getuser()/"postgres"/g' sapl/settings.py
- psql -c 'create database sapl;' -U postgres
script:
- ./manage.py migrate
- ./manage.py bower install
- pip freeze
- ./test_and_check_qa.sh

5
requirements/dev-requirements.txt

@ -2,11 +2,6 @@
autopep8==1.2.2 autopep8==1.2.2
beautifulsoup4==4.4.1 beautifulsoup4==4.4.1
django-debug-toolbar==1.4 django-debug-toolbar==1.4
django-extensions==1.6.1
django-floppyforms==1.6.1
easy-thumbnails==2.3
flake8==2.5.4
ipdb==0.9.0 ipdb==0.9.0
pygraphviz==1.3rc2 pygraphviz==1.3rc2
pytest-ipdb==0.1-prerelease2 pytest-ipdb==0.1-prerelease2

7
requirements/requirements.txt

@ -1,20 +1,23 @@
dj-database-url dj-database-url==0.4.1
django-admin-bootstrapped==2.5.7 django-admin-bootstrapped==2.5.7
django-bootstrap3==7.0.1 django-bootstrap3==7.0.1
django-bower==5.1.0 django-bower==5.1.0
django-braces==1.8.1 django-braces==1.8.1
django-compressor==2.0 django-compressor==2.0
django-crispy-forms==1.6.0 django-crispy-forms==1.6.0
python-decouple==3.0 django-extensions==1.6.1
django-extra-views==0.7.1 django-extra-views==0.7.1
django-filter==0.13.0 django-filter==0.13.0
django-floppyforms==1.6.1
django-model-utils==2.4 django-model-utils==2.4
django-sass-processor==0.3.4 django-sass-processor==0.3.4
django==1.9.5 django==1.9.5
djangorestframework djangorestframework
easy-thumbnails==2.3
git+git://github.com/interlegis/trml2pdf.git git+git://github.com/interlegis/trml2pdf.git
libsass==0.11.0 libsass==0.11.0
psycopg2==2.6.1 psycopg2==2.6.1
python-decouple==3.0
pytz==2016.3 pytz==2016.3
pyyaml==3.11 pyyaml==3.11
rtyaml==0.0.2 rtyaml==0.0.2

17
requirements/test-requirements.txt

@ -1,10 +1,11 @@
-r requirements.txt -r requirements.txt
coverage coverage==4.0.3
django-webtest django-webtest
isort flake8==2.5.4
model_mommy isort==4.2.5
pep8 model_mommy==1.2.6
pytest pep8==1.7.0
pytest-cov pytest==2.7.2
pytest-django pytest-cov==2.2.1
webtest pytest-django==2.9.1
webtest==2.0.21
Loading…
Cancel
Save