sudo: required
language: python
cache: pip
dist: trusty
python:
    - 3.6
services:
    - postgresql
    - docker
addons:
    postgresql: 9.6
    apt:
        packages:
            - postgresql-9.6-postgis-2.3
branches:
    only:
        - master
env:
    global:
        - SECRET_KEY=SecretKeyForTravis
        - DATABASE_URL="postgis://postgres@localhost:5432/travis_ci_test"
install:
    - pip install --upgrade pip
    - pip install --upgrade setuptools
    - pip install -r requirements.txt
before_script:
    - psql -U postgres -c "create database travis_ci_test;"
    - psql -U postgres -d travis_ci_test -c "create extension postgis;"
    - python manage.py migrate --noinput
script:
    - python manage.py test -k -v 0
before_deploy:
    - wget https://github.com/openshift/source-to-image/releases/download/v1.1.9a/source-to-image-v1.1.9a-40ad911d-linux-amd64.tar.gz
    - tar xvf source-to-image-v1.1.9a-40ad911d-linux-amd64.tar.gz
    - ./s2i build -e SECRET_KEY=${SECRET_KEY} . dbcawa/s2i-django dbcawa/ibms:${TRAVIS_BRANCH}
    - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
deploy:
    provider: script
    script: docker push dbcawa/ibms
    on:
        all_branches: true

sudo: false
language: python
cache: pip
dist: trusty
python:
    - 3.6
services:
    - postgresql
addons:
    postgresql: 9.6
    apt:
        packages:
            - postgresql-9.6-postgis-2.3
branches:
    only:
        - master
env:
    global:
        - SECRET_KEY=SecretKeyForTravis
        - DATABASE_URL="postgis://postgres@localhost:5432/travis_ci_test"
install:
    - pip install --upgrade pip
    - pip install --upgrade setuptools
    - pip install -r requirements.txt
before_script:
    - psql -U postgres -c "create database travis_ci_test;"
    - psql -U postgres -d travis_ci_test -c "create extension postgis;"
    - python manage.py migrate --noinput
script:
    - python manage.py test

Remove Docker image build/push from Travis CI at present.
Remove Docker image build/push from Travis CI at present.
