sudo: required

language: bash

services:
  - docker

install:
  - docker build -t quay.io/azavea/django:${TRAVIS_COMMIT:0:7} .

script:
  - docker run --rm quay.io/azavea/django:${TRAVIS_COMMIT:0:7} --version

after_success:
  - docker login -e . -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io
  - if [ "${TRAVIS_BRANCH}" == "develop" ]; then
    docker push quay.io/azavea/django:${TRAVIS_COMMIT:0:7};
    docker tag quay.io/azavea/django:${TRAVIS_COMMIT:0:7} quay.io/azavea/django:latest;
    docker push quay.io/azavea:django:latest;
    fi
  - if [ -n "${TRAVIS_TAG}" ]; then
    docker push quay.io/azavea/django:${TRAVIS_TAG};
    fi

sudo: required

language: bash

services:
  - docker

install:
  - docker build -t quay.io/azavea/django:${TRAVIS_COMMIT:0:7} .

script:
  - docker run --rm quay.io/azavea/django:${TRAVIS_COMMIT:0:7} --version

after_success:
  - docker login -e . -p "${QUAY_PASSWORD}" -u "${QUAY_USER}" quay.io
  - if [ "${TRAVIS_BRANCH}" == "develop" ]; then
    docker push quay.io/azavea/django:${TRAVIS_COMMIT:0:7};
    docker tag quay.io/azavea/django:${TRAVIS_COMMIT:0:7} quay.io/azavea/django:latest;
    docker push quay.io/azavea:django:latest;
    fi
  - if [ -n "${TRAVIS_TAG}" ]; then
    docker tag quay.io/azavea/django:${TRAVIS_COMMIT:0:7} quay.io/azavea/django:${TRAVIS_TAG};
    docker push quay.io/azavea/django:${TRAVIS_TAG};
    fi

Fix local creation of tagged image
Fix local creation of tagged image

Ensure that a tag with the version number is created locally so that it
can be pushed before attempting to push it.
