s3-deploy-website icon indicating copy to clipboard operation
s3-deploy-website copied to clipboard

What about providing an option to delete selectively?

Open lu911 opened this issue 6 years ago • 2 comments

I'm serving a react app from S3 and when I deploy previsously depolyed files get deleted. But I need to stay undeleted, if not my app dies for the duration of invalidation.

Currently there is a dry option in deploy function which is a logic to not delete files under current directory. How about we use this option to achieve my need?

lu911 avatar Jun 21 '18 01:06 lu911

I'm not sure I understand exactly what the issue is. Can you provide a more detailed scenario of what's happening currently and what you'd like to happen.

I'm not sure if the dry run option is something you can use here since during the dry run, nothing will change in the bucket or distribution.

jonls avatar Jul 06 '18 04:07 jonls

I looked into using s3-deploy-website and I have the same issue.

To simplify: say your app's filename change with each build (e.g. app-854421.js becomes app-652821.js. The fact that s3-deploy-website deletes before uploading means that the website will become unavailable until the new version is deployed.

A simple fix would be to delete the file after the new files after been uploaded. Should be just about moving around some code.

Your point about dry-mode not being a solution to this is spot on.

charlax avatar Aug 23 '18 09:08 charlax