dqtdz08206 2018-03-23 02:37
浏览 45
已采纳

AWS EB CLI - 每次运行'eb deploy'时排除特定文件夹

How to prevent specific folders from being replaced in every deployment? Consider the directory structure below:

-- /.ebextensions
-- /app
-- /database
-- /public
---- /css
---- /js
---- /images

I'm using AWS CodeCommit and EB CLI for my PHP application and every time I run eb deploy these files & directories are being replaced, so I want to exclude the /public/images directory so that the previous images that have been uploaded would still be there after a newer version has been deployed.

I've been digging on their documentation all week, but can't find any possible solution.Is this something possible with Elastic Beanstalk? Or any alternative suggestions for deployment in AWS will be very much appreciated. Thanks in advance!

  • 写回答

1条回答 默认 最新

  • douguiyan9164 2018-03-23 03:44
    关注

    Create a .ebignore file and list all files and directories there. If there is not .ebignore file it will use the .gitignore to exclude files from deployment.

    I still do not think it will resolve the issue since the images folder will still be deleted. I would suggest that you use S3 bucket and upload/get all images from there so you wont't have issues on deployment.

    Please note that if you upload an image, when there are 3 ec2 at that time of image upload, the image will only be uploaded on one server unless you sync the ec2 on every upload. And this will result in certain users getting a 404 image not found while others will be able to see it.

    You can also have a look at EBS volumes in order to try to achieve persistent storage with elastic beanstalk: https://aws.amazon.com/ebs/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器