Currently I am using S3 and CloudFront to host a static Angular App.
I want to version the app every time I made a deploy in order to ensure easy rollback (through my command line tools or automatic pipeline).
My S3 bucket would look something like this:
/production/v1.2
/production/v1.3
/production/v1.4
Next deploy will be in the folder /production/v1.5 and so on.
I want to use this strategy so that in case of rollback I just point the website to load from the old version /production/v1.4.
- My first solution to do this is update the CloudFront config Origin Path to point to the new folder, example
/production/v1.4 - In case of rollback I just update the CloudFront config Origin Path to
/production/v1.3
The second solution instead I was thinking to have a live/ folder and have a CloudFront Origin Path pointing to the live/index.html folder in S3 and copy there the last version of my app or copy the rollback version everytime without changing CloudFront Origin Path:
/production/v1.2
/production/v1.3
/production/v1.4
/production/live
- Deploy the new version in
/production/v1.4and/production/live - In case of rollback just copy
/production/v1.3to/production/live
Considering that it is not easy to update the CloudFront distrubution settings via cli and cache invalidations:
What do you recommend? Is there a better way to handle this kind of situation?