The pnpm cli deploy Command
The deploy command can be used to deploy the Central CDN from a local machine,
e.g. for development purposes. It is also run by the CICD GitHub workflow.
Main Steps
The main steps during the execution of the script are these:
- Some initial checks for prerequisites (AWS credentials, etc.) are performed.
- The 'origin config files' in the folder
origin-configare validated. Their complete content - no matter ifstage,prodorother- is stored in JSON format in/tmp/origin-config.json. - The origin data, i.e. all existing entries that start with
/<env_name>/sliceOrigins, is read from the Parameter Store and stored in a temporary JSON file. - The tests are run.
- The actual deployment via
cdk deployis executed.
Some More Details
- The CDK code uses the data that was collected by the
deploycommand to create the necessary AWS resources:/tmp/origin-config.jsonis used for param access roles.- the temporary JSON file is used to set the right origins in the CloudFront distribution.