<commit_before># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

notifications:
  email: false

sudo: false

addons:
  postgresql: 9.4

services:
  - mysql
  - postgresql
  - redis
  - rabbitmq

language: python

cache:
  - pip

env:
  global:
    - ES5_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz"
    - ES6_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.1.tar.gz"
    - ES7_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz"
    - ES_HOST=127.0.0.1
  matrix:
    # ES5 + MySQL
    - REQUIREMENTS=lowest EXTRAS=all,mysql,elasticsearch5 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES5_DOWNLOAD_URL
    # ES6 + MySQL
    - REQUIREMENTS=release EXTRAS=all,mysql,elasticsearch6 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES6_DOWNLOAD_URL
    # ES6 + PostgreSQL
    - REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch6 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES6_DOWNLOAD_URL
    # ES7 + MySQL
    - REQUIREMENTS=release EXTRAS=all,mysql,elasticsearch7 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES7_DOWNLOAD_URL
    # ES7 + PostgreSQL
    - REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch7 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES7_DOWNLOAD_URL

python:
  - "2.7"
  - "3.5"

matrix:
  fast_finish: true
  allow_failures:
    - env: REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch6 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES6_DOWNLOAD_URL

before_install:
  - "sudo apt-get install graphviz"
  - "nvm install 6; nvm use 6"
  - "mkdir /tmp/elasticsearch"
  - "wget -O - ${ES_URL} | tar xz --directory=/tmp/elasticsearch --strip-components=1"
  - "/tmp/elasticsearch/bin/elasticsearch > /tmp/local-es.log &"
  - "travis_retry pip install --upgrade pip setuptools py"
  - "travis_retry pip install twine wheel coveralls requirements-builder"
  - "requirements-builder -e $EXTRAS --level=min setup.py > .travis-lowest-requirements.txt"
  - "requirements-builder -e $EXTRAS --level=pypi setup.py > .travis-release-requirements.txt"
  - "requirements-builder -e $EXTRAS --level=dev --req requirements-devel.txt setup.py > .travis-devel-requirements.txt"
  - "mysql -e 'CREATE DATABASE IF NOT EXISTS invenio;' -uroot"
  - "psql -c 'CREATE DATABASE invenio;' -U postgres"

install:
  - "travis_retry pip install -r .travis-${REQUIREMENTS}-requirements.txt"
  - "travis_retry pip install -e .[${EXTRAS}]"

script:
  - /tmp/elasticsearch/bin/elasticsearch --version
  - wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 || cat /tmp/local-es.log
  - "./run-tests.sh"

after_success:
  - coveralls

deploy:
  provider: pypi
  user: inveniosoftware
  password:
    secure: "<KEY>
  distributions: "sdist bdist_wheel"
  on:
    tags: true
    python: "2.7"
    condition: $DEPLOY = true<commit_msg>travis: fix deploy condition<commit_after># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

notifications:
  email: false

sudo: false

addons:
  postgresql: 9.4

services:
  - mysql
  - postgresql
  - redis
  - rabbitmq

language: python

cache:
  - pip

env:
  global:
    - ES5_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz"
    - ES6_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.1.tar.gz"
    - ES7_DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz"
    - ES_HOST=127.0.0.1
  matrix:
    # ES5 + MySQL
    - REQUIREMENTS=lowest EXTRAS=all,mysql,elasticsearch5 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES5_DOWNLOAD_URL
    # ES6 + MySQL
    - REQUIREMENTS=release EXTRAS=all,mysql,elasticsearch6 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES6_DOWNLOAD_URL
    # ES6 + PostgreSQL
    - REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch6 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES6_DOWNLOAD_URL
    # ES7 + MySQL
    - REQUIREMENTS=release EXTRAS=all,mysql,elasticsearch7 SQLALCHEMY_DATABASE_URI="mysql+pymysql://travis@localhost:3306/invenio" ES_URL=$ES7_DOWNLOAD_URL
    # ES7 + PostgreSQL
    - REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch7 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES7_DOWNLOAD_URL DEPLOY=true

python:
  - "2.7"
  - "3.6"

matrix:
  fast_finish: true
  allow_failures:
    - env: REQUIREMENTS=devel EXTRAS=all,postgresql,elasticsearch6 SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://postgres@localhost:5432/invenio" ES_URL=$ES6_DOWNLOAD_URL

before_install:
  - "sudo apt-get install graphviz"
  - "nvm install 6; nvm use 6"
  - "mkdir /tmp/elasticsearch"
  - "wget -O - ${ES_URL} | tar xz --directory=/tmp/elasticsearch --strip-components=1"
  - "/tmp/elasticsearch/bin/elasticsearch > /tmp/local-es.log &"
  - "travis_retry pip install --upgrade pip setuptools py"
  - "travis_retry pip install twine wheel coveralls requirements-builder"
  - "requirements-builder -e $EXTRAS --level=min setup.py > .travis-lowest-requirements.txt"
  - "requirements-builder -e $EXTRAS --level=pypi setup.py > .travis-release-requirements.txt"
  - "requirements-builder -e $EXTRAS --level=dev --req requirements-devel.txt setup.py > .travis-devel-requirements.txt"
  - "mysql -e 'CREATE DATABASE IF NOT EXISTS invenio;' -uroot"
  - "psql -c 'CREATE DATABASE invenio;' -U postgres"

install:
  - "travis_retry pip install -r .travis-${REQUIREMENTS}-requirements.txt"
  - "travis_retry pip install -e .[${EXTRAS}]"

script:
  - /tmp/elasticsearch/bin/elasticsearch --version
  - wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200 || cat /tmp/local-es.log
  - "./run-tests.sh"

after_success:
  - coveralls

deploy:
  provider: pypi
  user: inveniosoftware
  password:
    secure: "<KEY>
  distributions: "sdist bdist_wheel"
  on:
    tags: true
    python: "3.6"
    condition: $DEPLOY = true
{'fraction_non_alphanumeric': 0.12934275830952022, 'fraction_numerical': 0.030079711234772145, 'mean_word_length': 4.127216653816499, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1292161', 'n_tokens_mistral': 2630, 'n_tokens_neox': 2551, 'n_words': 445}