machine:
  node:
    version: 5.7
  services:
    - docker
  environment:
    IMAGE_NAME: hello-node

dependencies:
  override:
    - docker info
    - docker build -t $IMAGE_NAME:$(git describe --tags --always) .
  pre:
    - npm install --production

test:
  override:
#    - docker run -d -p 3000:3000 $IMAGE_NAME:$(git describe --tags --always); sleep 10
#    - mocha test/integration
#    - istanbul cover _mocha --dir $CIRCLE_ARTIFACTS/coverage

deployment:
  elasticbeanstalk:
    branch: master
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker tag -f $IMAGE_NAME:$(git describe --tags --always) $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest
      - docker tag -f $IMAGE_NAME:$(git describe --tags --always) $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$(git describe --tags --always)
      - docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$(git describe --tags --always)
      - docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest
      - ./deploy.sh $(git describe --tags --always) $DOCKER_PRIVATE_REPO $IMAGE_NAME $EB_BUCKET $AWS_REGION $AWS_APP_NAME $AWS_APP_ENV

machine:
  node:
    version: 5.7
  services:
    - docker
  environment:
    IMAGE_NAME: hello-node

dependencies:
  override:
    - docker info
    - docker build -t $IMAGE_NAME:$(git describe --tags --always) .
  pre:
    - npm install
    - npm build:scss
    - npm build:js

test:
  override:
#    - docker run -d -p 3000:3000 $IMAGE_NAME:$(git describe --tags --always); sleep 10
#    - mocha test/integration
#    - istanbul cover _mocha --dir $CIRCLE_ARTIFACTS/coverage

deployment:
  elasticbeanstalk:
    branch: master
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker tag -f $IMAGE_NAME:$(git describe --tags --always) $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest
      - docker tag -f $IMAGE_NAME:$(git describe --tags --always) $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$(git describe --tags --always)
      - docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:$(git describe --tags --always)
      - docker push $DOCKER_PRIVATE_REPO/$IMAGE_NAME:latest
      - ./deploy.sh $(git describe --tags --always) $DOCKER_PRIVATE_REPO $IMAGE_NAME $EB_BUCKET $AWS_REGION $AWS_APP_NAME $AWS_APP_ENV

Build sass and js files
Build sass and js files
