#!/bin/bash -e

. VERSION

docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker tag docker-rails-onbuild $DOCKER_TAG:latest
docker push $DOCKER_TAG:latest

if ! docker pull $DOCKER_TAG:$VERSION; then
  echo "Releasing new version: $VERSION"

  docker tag docker-rails-onbuild $DOCKER_TAG:$VERSION
  docker push $DOCKER_TAG:$VERSION
else
  echo "Not overwriting existing version: $VERSION"
fi

#!/bin/bash -e

. VERSION

docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASSWORD
docker tag docker-rails-onbuild $DOCKER_TAG:latest
docker push $DOCKER_TAG:latest

if ! docker pull $DOCKER_TAG:$VERSION; then
  echo "Releasing new version: $VERSION"

  docker tag docker-rails-onbuild $DOCKER_TAG:$VERSION
  docker push $DOCKER_TAG:$VERSION
else
  echo "Not overwriting existing version: $VERSION"
fi

Revert "Don't need email for docker login anymore"
Revert "Don't need email for docker login anymore"

This reverts commit 871eb6ce6969b41978517f5f4c8923f4acfdae2d.

CircleCI 1.0 is stuck with Docker 1.10 which still needs email in login
