<commit_before>sudo: required

language: python

services:
  - docker

python:
  # We don't actually use the Travis Python, but this keeps it organized.
  - "2.7"
  - "3.6"

stages:
  - lint
  - test
  - geoserver_e2e_tests
  - name: deploy-pip
    if: tag =~ ^\d+\.\d+\.\d+$
  - name: deploy-conda
    if: tag =~ ^\d+\.\d+\.\d+$

install:
  - sudo apt-get update
  # We do this conditionally because it saves us some downloading if the
  # version is the same.
  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
      wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
    else
      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    fi
  - bash miniconda.sh -b -p $HOME/miniconda
  - export PATH="$HOME/miniconda/bin:$PATH"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
  # Useful for debugging any issues with conda
  - conda info -a
  # Create environment
  - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
  - source activate test-environment
  # Install dependencies
  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
      pip install -r requirements-py2.txt;
    else
      pip install -r requirements-py3.txt;
    fi
  - python setup.py develop

script:
  - coverage run --rcfile=coverage.ini setup.py test -s tethys_dataset_services.tests.unit_tests
  - coverage report -m

jobs:
  include:
    - stage: lint
      install:
        - pip install flake8
      script:
        - flake8
    - stage: geoserver_e2e_tests
      before_install:
        - docker pull ciwater/geoserver:2.8.2-clustered
        - docker pull mdillon/postgis:9.6
        - docker run -d --name=test_postgis -p localhost:5432:5432 -e POSTGRES_PASSWORD=<PASSWORD> -e POSTGRES_USER=postgres mdillon/postgis:9.6
        - docker run -d -p localhost:8181:8181 -p localhost:8081:8081 -p localhost:8082:8082 -p localhost:8083:8083 -p localhost:8084:8084 -e ENABLED_NODES=1 -e REST_NODES=1 -e MAX_MEMORY=512 -e MIN_MEMORY=512 -e NUM_CORES=2 -e MAX_TIMEOUT=60 ciwater/geoserver:2.8.2-clustered
        - docker exec test_postgis /bin/bash -c "psql -U postgres -c \"CREATE DATABASE tds_tests WITH OWNER postgres;\""
        - docker exec test_postgis /bin/bash -c "psql -U postgres -d tds_tests -c  \"CREATE EXTENSION postgis;\""
      script:
        - echo "GeoServer End to end tests"
    - stage: deploy-pip
      script:
        - echo "deploying to pip..."
    - stage: deploy-conda
      script:
        - echo "deploying to conda..."<commit_msg>Fix bad run command - ip addresses<commit_after>sudo: required

language: python

services:
  - docker

python:
  # We don't actually use the Travis Python, but this keeps it organized.
  - "2.7"
  - "3.6"

stages:
  - lint
  - test
  - geoserver_e2e_tests
  - name: deploy-pip
    if: tag =~ ^\d+\.\d+\.\d+$
  - name: deploy-conda
    if: tag =~ ^\d+\.\d+\.\d+$

install:
  - sudo apt-get update
  # We do this conditionally because it saves us some downloading if the
  # version is the same.
  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
      wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
    else
      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    fi
  - bash miniconda.sh -b -p $HOME/miniconda
  - export PATH="$HOME/miniconda/bin:$PATH"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
  # Useful for debugging any issues with conda
  - conda info -a
  # Create environment
  - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
  - source activate test-environment
  # Install dependencies
  - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
      pip install -r requirements-py2.txt;
    else
      pip install -r requirements-py3.txt;
    fi
  - python setup.py develop

script:
  - coverage run --rcfile=coverage.ini setup.py test -s tethys_dataset_services.tests.unit_tests
  - coverage report -m

jobs:
  include:
    - stage: lint
      install:
        - pip install flake8
      script:
        - flake8
    - stage: geoserver_e2e_tests
      before_install:
        - docker pull ciwater/geoserver:2.8.2-clustered
        - docker pull mdillon/postgis:9.6
        - docker run -d --name=test_postgis -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD=<PASSWORD> -e POSTGRES_USER=postgres mdillon/postgis:9.6
        - docker run -d -p 127.0.0.1:8181:8181 -p 127.0.0.1:8081:8081 -p 127.0.0.1:8082:8082 -p 127.0.0.1:8083:8083 -p 127.0.0.1:8084:8084 -e ENABLED_NODES=1 -e REST_NODES=1 -e MAX_MEMORY=512 -e MIN_MEMORY=512 -e NUM_CORES=2 -e MAX_TIMEOUT=60 ciwater/geoserver:2.8.2-clustered
        - docker exec test_postgis /bin/bash -c "psql -U postgres -c \"CREATE DATABASE tds_tests WITH OWNER postgres;\""
        - docker exec test_postgis /bin/bash -c "psql -U postgres -d tds_tests -c  \"CREATE EXTENSION postgis;\""
      script:
        - echo "GeoServer End to end tests"
    - stage: deploy-pip
      script:
        - echo "deploying to pip..."
    - stage: deploy-conda
      script:
        - echo "deploying to conda..."
{'fraction_non_alphanumeric': 0.12073945696129405, 'fraction_numerical': 0.04313498940881957, 'mean_word_length': 2.542974079126876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4954754', 'n_tokens_mistral': 2077, 'n_tokens_neox': 1924, 'n_words': 498}