Custom Deployment CLI for Angular Projects

Hi everyone,

I’ve created a mini-tutorial page on the process of creating an automatic deployment CLI for our Angular projects.

This one line execution will run the following:

  • ng build –prod
    • Make a final build of your application.
  • aws s3 rm s3://your-website –recursive
    • Deletes all the stuff in your bucket.
  • aws s3 cp ./dist s3://your-website –recursive
    • Copies the final dist folder that was compiled on your computer and uploads it to your bucket.
  • aws configure set preview.cloudfront true
    • Enable experimental abilities (which is needed to utilize create-invalidation)
  • aws cloudfront create-invalidation –distribution-id XXXXXXXXXXXXXX –paths ‘/*’
    • This will create an invalidation on CloudFront.  Replace XXXXXXXXXXXXXX with your CloudFront ID specific to your CloudFront distribution.

This is the deployment command:

yarn deploy

Please visit the Custom Deployment CLI for Angular Projects for the full details on creating this on the AWS platform.

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: