machine:
  services:
    - docker
  environment:
    IMAGE_NAME: rosscado/watchtower

dependencies:
  override:
    - docker pull centurylink/golang-builder:latest

test:
  override:
    - docker run -v $(pwd):/src centurylink/golang-builder:latest --test

deployment:
  hub:
    branch: hub
    commands:
      - docker run -v $(pwd):/src centurylink/golang-builder:latest
      - docker build -t $IMAGE_NAME:latest .
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push $IMAGE_NAME:latest
  hub_mirror:
    branch: auth
    owner: rosscado
    commands:
      - docker run -v $(pwd):/src centurylink/golang-builder:latest
      - docker build -t rosscado/watchtower:latest .
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push rosscado/watchtower:latest

machine:
  services:
    - docker
  environment:
    IMAGE_NAME: centurylink/watchtower

dependencies:
  override:
    - docker pull centurylink/golang-builder:latest

test:
  override:
    - docker run -v $(pwd):/src centurylink/golang-builder:latest --test

deployment:
  hub:
    branch: master
    commands:
      - docker run -v $(pwd):/src centurylink/golang-builder:latest
      - docker build -t $IMAGE_NAME:latest .
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push $IMAGE_NAME:latest
  hub_mirror:
    branch: [master, auth]
    owner: rosscado
    commands:
      - docker run -v $(pwd):/src centurylink/golang-builder:latest
      - docker build -t rosscado/watchtower:latest .
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push rosscado/watchtower:latest

Deploy to official and unofficial hubs
Deploy to official and unofficial hubs
