且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在AWS S3 + Cloudfront上更新Angular应用

更新时间:2022-03-07 22:20:58

您可以执行以下操作:

  1. 直接将构建文件夹部署到S3存储桶.
  2. 不需要缓存index.html文件
  3. 每当您将内部版本部署或上载到S3时,请执行以下步骤
  4. 转到云端
  5. 使对象无效
  6. 创建条目/*
  1. Directly deploy build folder to S3 bucket.
  2. Not required to cached index.html file
  3. Whenever you deployed or upload build to S3,do the following step
  4. Go to cloudfront
  5. Do invalidation of objects
  6. Create entry /*

部署脚本

对于连续部署,您可以使用ac的boto3编写脚本,以在文件夹成功上传后自动使缓存无效.

For continuous deployment you can write script using boto3 of aws for automatically invalidate cached once folder uploaded successfully.