Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude directories from elastic beanstalk deploy

I have some directories that I would like to be in my local git repository, but NOT in the remote repository when I deploy to my beanstalk environment.

I have googled a bit, and found a few years old posts like this:

http://blog.beanstalkapp.com/post/38164899272/patterns-for-excluded-deployment-paths

that explain that there is this option somewhere, but I have looked everywhere and cannot find it. I think it must still be there and possibly it's been moved around?

If that helps (though it probably doesn't make any difference), I've got an environment based on the sample node.js application. Where is this option?

Is it possible to do it in a config file in the .ebextensions folder instead?

like image 488
Gio Avatar asked Feb 27 '15 10:02

Gio


2 Answers

With the current eb cli v3.x elastic beanstalk supports the .ebignore file. It follows the same format as a .gitignore file and it replaces it on deploy.

If you want to use .ebignore then you need to copy your .gitignore into the file and then add the extra exclusions to the file. If you edit your .gitignore file in the future you will need to replicate any changes into you .ebignore file.

See elastic beanstalk docs for more details

like image 106
nmott Avatar answered Oct 17 '22 04:10

nmott


Unfortunately, this is not currently possible. The best workaround right now is to create your own zip and tell the CLI to use it instead. You can do this by adding the following lines to .elasticbeanstalk/config.yml

deploy:
  artifact: /path/to/file.zip

If you can script your zip, you could add an alias like

alias ebdeploy="zip {your zip stuff here}; eb deploy"
like image 28
Nick Humrich Avatar answered Oct 17 '22 05:10

Nick Humrich