language: generic
sudo: required
os:
- linux
services:
- docker
env:
  matrix:
  - CONDA_PY=36
  global:
    secure: =
install:
- |
  echo "Installing a fresh version of Miniconda."
  MINICONDA_URL="https://repo.continuum.io/miniconda"
  MINICONDA_FILE="Miniconda3-latest-$(case $TRAVIS_OS_NAME in (linux) echo Linux;; (osx) echo MacOSX;;esac)-x86_64.sh"
  curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}"
  bash $MINICONDA_FILE -b
- |
  echo "Configuring conda."
  source $HOME/miniconda3/bin/activate root
  conda install -y conda-build anaconda-client flake8 conda-verify
script:
- |
  flake8 .
  conda build -c intake -c defaults -c conda-forge ./conda
- |
  if [ -n "$TRAVIS_TAG" ]; then
      # If tagged git version, upload package to main channel
      anaconda -t ${ANACONDA_TOKEN} upload -u intake --force `conda build --output ./conda`
  fi
notifications:
  email: false
  on_success: change
  on_failure: always
