
machine:
  services:
    - docker

dependencies:
  override:
    - docker info
    - docker build -t www-cbd-int --build-arg COMMIT=$CIRCLE_SHA1 .

test:
  override:
    - docker run -d -p 8000:8000 www-cbd-int; sleep 10
    - curl --retry 10 --retry-delay 5 -v http://localhost:8000/insession/
    - curl --retry 10 --retry-delay 5 -v http://localhost:8000/reports/map/

deployment:
  hub:
    tag: /^v[0-9]+(\.[0-9]+)*$/
    owner: scbd
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker tag www-cbd-int scbd/www-cbd-int:${CIRCLE_TAG//v/}
      - docker tag www-cbd-int scbd/www-cbd-int:latest
      - docker push scbd/www-cbd-int:${CIRCLE_TAG//v/}
      - docker push scbd/www-cbd-int:latest


machine:
  services:
    - docker

dependencies:
  override:
    - docker info
    - docker build -t www-cbd-int --build-arg COMMIT=$CIRCLE_SHA1 .

test:
  override:
    - docker run -d -p 8000:8000 www-cbd-int; sleep 10
    - curl --retry 10 --retry-delay 5 -v http://localhost:8000/insession/
    - curl --retry 10 --retry-delay 5 -v http://localhost:8000/reports/map/

deployment:
  staging:
    branch: staging
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker tag www-cbd-int scbd/www-cbd-int:staging
      - docker push scbd/www-cbd-int:staging
  hub:
    tag: /^v[0-9]+(\.[0-9]+)*$/
    owner: scbd
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker tag www-cbd-int scbd/www-cbd-int:${CIRCLE_TAG//v/}
      - docker tag www-cbd-int scbd/www-cbd-int:latest
      - docker push scbd/www-cbd-int:${CIRCLE_TAG//v/}
      - docker push scbd/www-cbd-int:latest

Deploy automatically staging branch to Docker Hub
Deploy automatically staging branch to Docker Hub