Build & Deploy

Infrastructure

There is presently a chicken & egg situation with the CloudFront-Auth Lambda and the CloudFront distribution both requiring TF outputs from each other. Work-around at this time is to just:

  1. Run the terraform with a fake lambda
  2. Kick off the lambda build pipeline to create a lambda with the correct config
  3. Rerun the terraform with the correctly built package.zip in place.

Terraform infrastructure

cd src/terraform/env/prod
terragrunt init
terragrunt plan
terragrunt apply

Content

Content is filed in a dedicated AWS CodeCommit repo.

Check out that repo as per the usual CodeCommit instructions. Then:

1 Edit content & serve locally

cd .
invoke livereload &
# vi content/articles/build-and-deploy.md 
# fg
# ^C

2 Check for Broken Links

ToDo: Move this to the publishing CD/CD pipeline

cd .
invoke build
TPID=$(mktemp)
nohup invoke serve > /dev/null 2>&1 & echo $! > "${TPID}"
linkchecker http://localhost:8000/
echo $?

kill $(cat "${TPID}")

3 Publish

Commit the content to main and push it up to CodeCommit to activate the CI/CD publishing pipeline.

links

social