Synopsis

This page describes the steps required to implementing an automated way of pushing your Angular 4 application without having to manually upload your Angular production build.

Specifically, the exact flow of the automation will do the following:

  1. Install required CLIs such as NPM, Yarn, and Angular CLI.
  2. Run ng build –prod
  3. Clear S3 bucket.
  4. Push build contents to S3 bucket.
  5. Create invalidation on AWS CloudFront

Requirements

Your Angular project must utilize a Git repository that is supported by AWS CodeBuild: GitHub, AWS CodeCommit

Source: AWS CodeBuild FAQ

Integration Process

AWS S3 Setup

 

AWS CloudFront

 

AWS CodeBuild

 

AWS CodePipeline

 

Optional Integration

So, I know you’re probably like me.  You have to consistently check your app for errors and sometimes you don’t cover all parts of your application.

What if there is a way to automate that process?  Additionally, what if there’s a way to prevent your application from being deployed upon finding out that specific components don’t compile?

There is and it’s called Unit Testing.

Unit Tests