awslabs / aws-api-gateway-developer-portal

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

Changes to custom-content images aren't deployed to the static assets bucket #459

Closed ngalchemist closed 3 years ago

ngalchemist commented 3 years ago

Dev Portal version v3.0.6

My changes aren't uploaded to the static assets bucket, even when passing the StaticAssetRebuildToken in the sam deploy command.

Replication steps:

  1. Package:

sam package --template-file ./cloudformation/template.yaml --output-template-file ./cloudformation/packaged.yaml --s3-bucket

  1. Deploy:

sam deploy --template-file ./cloudformation/template.yaml --stack-name dev-portal --s3-bucket --capabilities CAPABILITY_NAMED_IAM --parameter-overrides DevPortalSiteS3BucketName= ArtifactsS3BucketName= CognitoDomainNameOrPrefix=

  1. Overwrite /dev-portal/public/custom-content/nav-logo.png locally.
  2. Deploy again:

sam deploy --template-file ./cloudformation/template.yaml --stack-name dev-portal --s3-bucket --capabilities CAPABILITY_NAMED_IAM --parameter-overrides DevPortalSiteS3BucketName= ArtifactsS3BucketName= CognitoDomainNameOrPrefix= StaticAssetRebuildToken=

When I check the static assets bucket (DevPortalSiteS3BucketName) the files from the initial deployment are still present.

ghost commented 3 years ago

The readme's instructions are incorrect and need updated. You'll need to rebuild the assets manually and then deploy.

ghost commented 3 years ago

Update: I misread your version number. Here's what you'll need to do for v3.x:

  1. If you haven't installed Node, you'll need to do so.
  2. Open a terminal, navigate to the dev-portal directory of your repo.
  3. Run npm install then npm run build.
  4. Then try deploying again.

Sorry about that!