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

customisations aren't picked up during sam package command execution #391

Open DiemanXT1 opened 4 years ago

DiemanXT1 commented 4 years ago

Hi, I've cloned repo to one of my ec2 instances. Made required customisations, exmaple: I've updated the file NavBar.jsx in ./home/ubuntu/aws-api-gateway-developer-portal/dev-portal/src/components folder. After I ran package and then used generated yaml file to update stack via CF (using new Token and even override option) I still can see old files being used.

Does this happen cause I am picking up generated yaml file and deploying it via CF manually (via Terraform actually) instead of using SAM deploy command?

Thank you in advance for help.

Cheers, DiemanXT

john-uc commented 4 years ago

@DiemanXT1 Hey there there something you need to understand about the developer portal .

  1. This project is completely build on Node and one the first things this project does is it will compress the css and js files and creates maps , which are readable for a developer. and these files are something that is deployed when you do a sam deploy.
  2. this project has a precompiled set of map files which are located in lambdas/static-asset-uploader/build/ so everytime you do sam deploy this will deploy the build which the developers have already compiled.
  3. if you need to make customisation then you need to do a node build and replace the files located in lambdas/static-asset-uploader/build/ an do a sam deploy. you can refer the how to section from here (please ignore step 5 )

i too was stuck with this in the beginning but a lil bit of exploring and trail and errors and i was able to figure this out

DiemanXT commented 4 years ago

Hi @john-uc, thank you. Figured it out and was able to customise portal as needed. Won’t hurt to have this documented though.

ghost commented 4 years ago

Some basic instructions for customization now exist here. This doesn't go into detail on how to customize beyond at a very high level, but for template modifications specifically, you should modify cloudformation/template.yaml, not cloudformation/packaged.yaml (which itself is kept out of version control).