Elastic Beanstalk deployment with git & .ebignore



I’ve been rejiggering my organization’s deployment of a Node Express application using Elastic Beanstalk and git.

It works as expected with the following deployment phase (partial circle.yml):

    branch: master
      - git add . && git commit -m 'automatic building for prod'
      - eb deploy dojo-prod --profile=default --timeout=30
      - eb deploy dojo-work --profile=default
      - eb deploy dojo-export-worker --profile=default

However, this setup forces us to include our build files in the git repository.

I know that Elastic Beanstalk has a feature where you can include an “.ebignore” file that will override anything in .gitignore so that build files can be excluded there, but I’m finding that even the presence of an .ebignore, regardless of its contents, will just cause the “eb deploy” step to hang indefinitely until it times out.

(Bear in mind I am removing the “git add…” command when I do this as there is nothing to commit when build files are excluded in .gitignore).

Does anyone have any experience with implementing an .ebignore file on CircleCI? Any help would be much appreciated!



In case anyone’s experiencing similar issues, we determined the issue was that whichever glob algorithm EB uses when packaging the app using .ebignore is extremely inefficient as compared to the regular .gitignore method.

We fixed the problem by removing the node_modules folder (which in our case is extremely large since our app is React + Node).