matrix:
  PYTHON_VERSION:
  - 2.7
  - 3.6

pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./cache
    volumes:
      - /tmp/drone-cache:/cache
  test:
    image: python:${PYTHON_VERSION}-slim-jessie
    commands:
    - pip install -r requirements.txt
    - python -m unittest discover -s tests
    environment:
    - XDG_CACHE_HOME=./cache
    - TESTING=true
    when:
      event: push
  publish:
    image: plugins/docker
    repo: datashaman/wifidog-auth-flask
    tags: ${DRONE_COMMIT_BRANCH/master/latest}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    keep_build: true
    environment:
    - DOCKER_CONTENT_TRUST=1
    when:
      event: push
      matrix:
        PYTHON_VERSION: 3.6
    secrets:
    - docker_content_trust_repository_passphrase
    - docker_content_trust_root_passphrase
    - docker_password
    - docker_username
  rebuild-cache:
    image: drillster/drone-volume-cache
    rebuild: true
    mount:
      - ./cache
    volumes:
      - /tmp/drone-cache:/cache
  notify:
    image: plugins/slack
    channel: ci
    when:
      status: [ success, failure ]
    secrets: [ slack_webhook ]

matrix:
  PYTHON_VERSION:
  - 2.7
  - 3.6

pipeline:
  restore-cache:
    image: drillster/drone-volume-cache
    restore: true
    mount:
      - ./cache
    volumes:
      - /tmp/drone-cache:/cache
  test:
    image: python:${PYTHON_VERSION}-slim-jessie
    commands:
    - pip install -r requirements.txt
    - python -m unittest discover -s tests
    environment:
    - XDG_CACHE_HOME=./cache
    - TESTING=true
    when:
      event: push
  publish:
    image: plugins/docker
    repo: datashaman/wifidog-auth-flask
    tags: ${DRONE_COMMIT_BRANCH/master/latest}
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    keep_build: true
    when:
      event: push
      matrix:
        PYTHON_VERSION: 3.6
    secrets:
    - docker_password
    - docker_username
  rebuild-cache:
    image: drillster/drone-volume-cache
    rebuild: true
    mount:
      - ./cache
    volumes:
      - /tmp/drone-cache:/cache
  notify:
    image: plugins/slack
    channel: ci
    when:
      status: [ success, failure ]
    secrets: [ slack_webhook ]

Remove content trust, not 100% working yet
Remove content trust, not 100% working yet
