Tutorial: Operations

Operations

This project is intended to be statically hosted with a CDN and cached so that resources can be served efficiently at any scale, and using CI/CD such that pushing code to the master branch is sufficient to update the project for all consumers (given sufficient cache-invalidation time).

Overview

  • An AWS Cloudfront Distribution provides the CDN caching layer that delivers content to the user quickly, without consuming the more expensive S3 resource directly.
  • An AWS S3 Bucket stores the static files generated by CI/CD efficiently at any scale.
  • Bitbucket's CI/CD pipeline automatically recognizes changes to the source code and runs automated tests before updating the static files and invalidating caches.

CI/CD

Changes to the master branch trigger updates to the CDN. Our pipeline automatically builds the library, updates the files stored in AWS S3, and files a cache invalidation with cloudfront such that edge locations begin to serve updated content within minutes.

See bitbucket-pipelines.yml for the steps run.

Bitbucket Pipeline Variables

The CI/CD pipeline provided by Bitbucket uses the following variables to deploy changes to the repository.

Variable Description
S3_BUCKET AWS S3 Bucket name to sync static data to
AWS_DISTRIBUTION_ID Cloudfront Distribution Id for cache invalidations