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?
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.
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"
来源:https://stackoverflow.com/questions/28763205/exclude-directories-from-elastic-beanstalk-deploy