Django Deployment Runbook¶
Prerequisites¶
- GitLab access to
nova-hc/novahomecareapi - AWS SSM access via
794248400165_AdministratorAccessprofile
Automated (CI/CD)¶
- Push to
mainbranch - GitLab CI pipeline:
- Builds Docker image
- Pushes to ECR
- Triggers SSM RunShellScript on
ec2-django
- Instance pulls new image and restarts
Manual Deployment¶
If the CI pipeline fails, deploy manually:
# 1. SSM into the Django instance
aws ssm start-session \
--target <instance-id> \
--profile 794248400165_AdministratorAccess
# 2. On the instance
cd /opt/app
docker compose pull
docker compose up -d
# 3. Verify health
curl http://localhost:8000/ping/
Rollback¶
# On the instance — revert to previous image
docker compose down
docker tag <previous-image> <current-tag>
docker compose up -d
Health Checks¶
| Endpoint | Expected |
|---|---|
/ping/ |
200 OK |
/api/ |
200 OK |
/admin/ |
302 → login |