Pipelines CI/CD
Pipeline Canary
Deploy automático para canary ao fazer push na branch canary
Arquivo: workflows/deploy-canary.yml
Nome no Actions: Deploy to Amazon ECS
Trigger
on:
push:
branches:
- canaryQualquer push na branch canary dispara o workflow — tipicamente após validação em staging e merge de release-X.Y.Z.
Destino na AWS
| Recurso | Valor |
|---|---|
| Região | us-west-2 |
| Repositório ECR | qyon-crm-geiko-service/canary |
| Cluster ECS | qyon-crm-canary |
| Service ECS | qyon-crm-geiko-canary-svc |
Etapas do job
A sequência é idêntica à de staging, mudando apenas repositório ECR, cluster e service:
| # | Step | O que faz |
|---|---|---|
| 1 | Checkout | Clona o repositório |
| 2 | Use Node.js 20 | Instala Node 20 |
| 3 | Get Branch Name | Resolve branch release-X.Y.Z |
| 4 | Extract Tag from Branch | Extrai semver ou falha |
| 5 | Configure AWS credentials | AWS_CRM_* |
| 6 | Login to Amazon ECR | Login no registry |
| 7 | Build, tag, and push image | Tags X.Y.Z e latest em .../canary |
| 8 | Deploy to ECS | aws ecs update-service --cluster qyon-crm-canary --service qyon-crm-geiko-canary-svc --force-new-deployment |
Build da imagem
ECR_REPOSITORY=qyon-crm-geiko-service/canary
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest .Papel do canary
O ambiente canary recebe a mesma versão semver validada em staging, em infraestrutura separada (qyon-crm-canary), permitindo observar comportamento com tráfego real ou limitado antes da produção.
Esta pipeline também não cria Git tag nem GitHub Release — isso só ocorre em production.