Estado pipeline✓ Passedbuild → test → security → deploy
🔄 Pipeline CI/CD — GitHub Actions
✓ main branch
Commit: a7f3e2c ·
Branch: main ·
Duración total: 4m 23s
🏗️
Build
1m 05s
✓ passed
→
🧪
Test
1m 48s
✓ 142/142
→
🔒
Security
0m 52s
✓ 0 CRITICAL
→
🚀
Deploy
0m 38s
✓ EKS prod
.github/workflows/ci.ymlYAML
# Generado por pipeline_generator.py — CultivaSaaSname:CI/CD Pipelineon:push:branches:[main,develop]pull_request:branches:[main]jobs:build:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-run:npm ci && npm run buildtest:needs:[build]runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-run:npm test -- --coveragesecurity:needs:[test]runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-name:Run Trivy filesystem scanuses:aquasecurity/trivy-action@masterwith:scan-type:'fs'severity:'CRITICAL,HIGH'exit-code:'1'deploy:needs:[security]if:github.ref == 'refs/heads/main'steps:-name:Build and push imageuses:docker/build-push-action@v5with:push:truetags:ghcr.io/${{ github.repository }}:${{ github.sha }}-name:Deploy blue slot to EKS productionrun:kubectl apply -f deploy/production/deployment-blue.yaml
⚓ Kubernetes — Blue/Green Deployment · namespace: production
Diagrama de tráfico actual — slot blue activo recibiendo 100% del tráfico
apiVersion:apps/v1kind:Deploymentmetadata:name:api-bluenamespace:productionlabels:app:apislot:bluespec:replicas:3selector:matchLabels:app:apislot:bluetemplate:spec:containers:-name:appimage:ghcr.io/cultiva-saas/api:v2.4.1readinessProbe:# health gatehttpGet:path:/api/healthport:3000initialDelaySeconds:10periodSeconds:5resources:requests:cpu:"500m"memory:"512Mi"limits:cpu:"1000m"memory:"1Gi"
deploy/production/service.yamlService
apiVersion:v1kind:Servicemetadata:name:api-svcnamespace:productionspec:selector:app:apislot:blue# ← cambiar a green# para el switchports:-port:80targetPort:3000# Traffic switch command:# kubectl patch service api-svc \# -n production \# -p '{"spec":{"selector":# {"app":"api","slot":"blue"}}}'
variable"service_name"{description="Name of the ECS service"type=string}variable"container_image"{description="Container image (repo:tag)"type=string# ghcr.io/cultiva-saas/api:v2.4.1}variable"cpu"{description="Fargate task CPU units"type=numberdefault=512# production}variable"memory"{description="Fargate task memory (MiB)"type=numberdefault=1024# production}variable"desired_count"{description="Desired task count"type=numberdefault=3}variable"env_vars"{description="Env vars for container"type=map(string)default={NODE_ENV="production"PORT="3000"LOG_LEVEL="info"}}
📋 Runbook — Deploy Blue/Green v2.4.1 → Production
Generado por deployment_manager.py deploy --env=production --image=ghcr.io/cultiva-saas/api:v2.4.1 --strategy=blue-green
1
Aplicar manifiesto blue
Despliega los pods del slot blue sin recibir tráfico todavía