Skip to content

Django Deployment Runbook

Prerequisites

  • GitLab access to nova-hc/novahomecareapi
  • AWS SSM access via 794248400165_AdministratorAccess profile

Automated (CI/CD)

  1. Push to main branch
  2. GitLab CI pipeline:
    • Builds Docker image
    • Pushes to ECR
    • Triggers SSM RunShellScript on ec2-django
  3. 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