machine:
  services:
    - docker

dependencies:
  override:
    - docker info
    # our circle setup uses compose - install it
    - sudo pip install --upgrade docker-compose==1.2.0
    # install AWS CLI
    - sudo pip install awscli
    # build the image
    - docker build -t soutech/champaign_web:$CIRCLE_SHA1 .

test:
  override:
    # tests the built image
    - cat circle/docker-compose-template.yml | envsubst > circle/docker-compose.yml
    - cat Dockerrun.aws.json.template | envsubst > Dockerrun.aws.json
    - annotate-output docker-compose -f circle/docker-compose.yml run web

database:
  override:
    - echo "look in circle/specs-and-rake-tasks for database setup for testing environment"

deployment:
  production:
    branch: master
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push soutech/champaign_web
      - ./deploy.sh $CIRCLE_SHA1 'champaign' 'champaign-production'
  staging:
    branch: development
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push soutech/champaign_web
      - ./deploy.sh $CIRCLE_SHA1 'champaign' 'champaign-staging'

machine:
  services:
    - docker

dependencies:
  override:
    - docker info
    # our circle setup uses compose - install it
    - sudo pip install --upgrade docker-compose==1.2.0
    # install AWS CLI
    - sudo pip install awscli
    # build the image
    - docker build -t soutech/champaign_web:$CIRCLE_SHA1 .

test:
  override:
    # tests the built image
    - cat circle/docker-compose-template.yml | envsubst > circle/docker-compose.yml
    - cat Dockerrun.aws.json.template | envsubst > Dockerrun.aws.json
    - annotate-output docker-compose -f circle/docker-compose.yml run web

database:
  override:
    - echo "look in circle/specs-and-rake-tasks for database setup for testing environment"

deployment:
  production:
    branch: master
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push soutech/champaign_web
      - ./deploy.sh $CIRCLE_SHA1 'champaign' 'champaign-production'
  staging:
    branch: development
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - docker push soutech/champaign_web
      - ./deploy.sh $CIRCLE_SHA1 'champaign' 'champaign-staging'
  testing:
      branch: testing-env
      commands:
        - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
        - docker push soutech/champaign_web
        - ./deploy.sh $CIRCLE_SHA1 'champaign' 'champaign-testing'

Add option to deploy to testing environment through CircleCI
Add option to deploy to testing environment through CircleCI
