Exclude directories from elastic beanstalk deploy

2019-04-04 05:34发布

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?

2条回答
欢心
2楼-- · 2019-04-04 06:09

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

查看更多
走好不送
3楼-- · 2019-04-04 06:28

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"
查看更多
登录 后发表回答