v2.4.2

CI/CD

CircleCI. Config in .circleci/.

Workflow

flowchart LR
  PR[Pull request] --> TEST[test workflow]
  PUSH[Push to develop/staging/prod] --> GEN[generate-deploy-config]
  GEN -->|changed services| DEP[deploy workflow]
  DEP --> SVC1[sls deploy - leads]
  DEP --> SVC2[sls deploy - marketplace]
  DEP --> SVCN[sls deploy - ...]

Diff-based service selection

generate-deploy-config diffs HEAD vs HEAD^1, finds changed services/* dirs, emits a continuation workflow:

bash
SERVICES_TO_DEPLOY=[$(git diff HEAD HEAD^1 --name-only | grep services | xargs -L 1 dirname | cut -d "/" -f 1-2 | uniq | ...)]
  • FORCE_ALL=true bypasses the diff, deploys every service.
  • Changes to libs/* (shared workspace deps) trigger deploy of all services.

Rendered with ytt from .circleci/templates/fragments.lib.yml + deploy_workflow.tpl.yml.circleci/generated_continuation.yml.

Per-service deploy

bash
sls deploy -c ./serverless.yml --stage <stage> --region ap-southeast-2

via the g:deploy:<stage> workspace script, with the matching AWS profile.

Environments

BranchDeploys toProfile
PR / feature(test only)
developdevaws-drive-staging-admin
stagingstagingaws-drive-staging-admin
prod / tagsprodaws-drive-prod-admin

Stack output

Each service writes outputs to outputs/stack.<stage>-<service>.json via @anttiviljami/serverless-stack-output (custom.output in each serverless.yml).

Terraform

Runs through Terraform Cloud (remote backend), not CircleCI. plan on every TFC run; apply requires a confirmed apply in the TFC UI. See Terraform layout.

Esc