Elastic Beanstalk deployment from multiple branches

Hey Everyone,

Im having a hard time figuring out how to deploy multiple branches to different environments on elastic beanstalk using docker + circle CI. For example, I would simply like to deploy master to production environment and development to a staging one. If I have 2 elastic beanstalks listed in my circle.yml file it only picks up the development one and not master. Am I missing something. Doing it the normal way without eb works but I need to deploy to eb. Here is my circle.yml file.


machine:
  services:
    - docker
dependencies:
  override:
    - docker info
    - docker build -t ch*****/*****:$CIRCLE_SHA1 .
test:
  override:
    - docker run -t -p 8080:8080 -e CONTINUOUS_INTEGRATION=true chmaltsp/if-planning:$CIRCLE_SHA1 npm test

## Customize deployment commands
deployment:
  elasticbeanstalk:
    branch: master
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - aws configure set default.region us-west-2
      - ./deploy.sh $CIRCLE_SHA1
  elasticbeanstalk:
    branch: development
    commands:
      - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
      - aws configure set default.region us-west-2
      - ./deploydev.sh $CIRCLE_SHA1

Any help would be much appreciated.

3 Likes