From dac80e928db347be3d296164d246e17759056f87 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 3 May 2016 10:41:10 -0300 Subject: [PATCH] Insere a verificacao com o Travis apos testes em um fork do sapl --- .env_dev | 8 ++++++++ .travis.yml | 48 +++++++++++++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 .env_dev diff --git a/.env_dev b/.env_dev new file mode 100644 index 000000000..db1a6ff5a --- /dev/null +++ b/.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' \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8060b70f9..77b6e6b60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,44 @@ language: python +sudo: required python: - "3.4.3" +services: + - postgresql + +addons: + postgresql: "9.3" + install: - - pip install . - - sudo ln -s /usr/bin/nodejs /usr/bin/node - - sudo npm install -g bower - - pkg-config postgresql postgresql-contrib pgadmin3 python-psycopg2 nodejs npm - - pip install -r requirements/test-requirements.txt - - python setup.py -q 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/dev-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 -before script: - -./manage.py bower install - -./manage.py migrate -scripts: - - test_and_check_qa +script: + - ./manage.py migrate + - ./manage.py bower install + - ./test_and_check_qa.sh \ No newline at end of file