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:
SERVICES_TO_DEPLOY=[$(git diff HEAD HEAD^1 --name-only | grep services | xargs -L 1 dirname | cut -d "/" -f 1-2 | uniq | ...)]FORCE_ALL=truebypasses 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
sls deploy -c ./serverless.yml --stage <stage> --region ap-southeast-2via the g:deploy:<stage> workspace script, with the matching AWS profile.
Environments
| Branch | Deploys to | Profile |
|---|---|---|
| PR / feature | (test only) | — |
develop | dev | aws-drive-staging-admin |
staging | staging | aws-drive-staging-admin |
prod / tags | prod | aws-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.