awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
928 stars 400 forks source link

Static files do not get updated on consecutive deployments #381

Open john-uc opened 4 years ago

john-uc commented 4 years ago

Lets say i do a npm run build which will generate a few static js files. and i go ahead and do changes to the code by adding and deleting a few things . the next time i do a npm run build i see that new JS files are getting created.

the problem arises while running npm run deploy Expected behaviour : old files should be deleted from S3 and the new JS files should go there , and the portal should reflect those changes.

Actual Behaviour : Old files gets reuploaded to S3 (their last updated date has changed) and no changes in dev portal

@Trial-In-Error @amazon-meaisiah . Any suggestions on how i can go about with this ?

ghost commented 4 years ago

If you have staticAssetRebuildMode: 'overwrite-content' set in your dev-portal/deployer.config.js, this is expected behavior.

I have two questions:

  1. What's your deployer.config.js look like?
  2. Have you made any other alterations to the code?
hk1313 commented 3 years ago

@Trial-In-Error can we resolve this issue by creating additional lambda which will trigger invalidation on cloudfromt distribution?

echo-bravo-yahoo commented 3 years ago

@hk1313 Hi! I no longer work on this team, but the root cause is: https://github.com/awslabs/aws-api-gateway-developer-portal/issues/228

You could create an additional lambda to trigger invalidation or contribute a fix to the staticAssetUploader lambda implementing issue 228. :)