Metadata-Version: 2.4
Name: predeploy-doctor
Version: 0.1.0
Summary: A local DevOps readiness checker for safer deployments.
Author: AyaanB24
License: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Requires-Dist: click>=8.0.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Description-Content-Type: text/markdown

# 🩺 Pre-Deploy Doctor

**Pre-Deploy Doctor** is a local DevOps readiness checker that validates whether your environment is safe to deploy BEFORE you run Docker, kubectl, or CI/CD pipelines.

It runs 100% locally, requires no cloud accounts or AI, and is designed to catch common "stupid" mistakes before they hit your production infrastructure.

## 🚀 Features

- **Docker Health**: Checks if Docker is installed and the daemon is actually running.
- **Environment Validation**: Loads `.env` and validates that your required environment variables are set.
- **Port Conflicts**: Identifies if required ports are already in use and shows the conflicting process name.
- **Kubernetes Context Safety**: Warns you if your `kubectl` context isn't in your "allowed" list for the project.
- **Project Structure**: Ensures critical files like `Dockerfile` are present.

## 📦 Installation

```bash
pip install predeploy-doctor
```

## 🛠 Usage

Run inside any project directory:

```bash
predeploy check
```

### Configuration (`predeploy.yaml`)

Create a `predeploy.yaml` in your project root to customize the checks:

```yaml
required_env:
  - DB_URL
  - SECRET_KEY

required_ports:
  - 3000
  - 5432

kubernetes:
  allowed_contexts:
    - dev
    - staging
    - minikube
```

## 📋 Sample Output

```text
🩺 Pre-Deploy Doctor Report

✔ Docker is running
✔ Found Dockerfile
✔ All required environment variables are set
❌ Port 3000 already in use (Process: node)
⚠ Kubernetes context 'production' not in allowed list

==============================
Status: ❌ NOT SAFE TO DEPLOY
```

## 🔢 Exit Codes

- `0`: All checks passed (or only warnings). Safe to deploy.
- `1`: One or more critical checks failed. **Deployment should be blocked.**

## 📜 License

MIT
