Metadata-Version: 2.4
Name: fastpluggy-fp-deployer
Version: 0.4.41
Summary: Deployment management plugin for FastPluggy — generates and deploys Docker stacks or native systemd units from app manifests
Author: FastPluggy Team
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: FastPluggy>=0.4.0
Requires-Dist: loguru
Requires-Dist: jinja2
Requires-Dist: pydantic
Requires-Dist: pyyaml
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Provides-Extra: e2e
Requires-Dist: fastpluggy-cli; extra == "e2e"

# fp_deployer

Deployment management plugin for FastPluggy. Generates and deploys production-grade Docker stacks from declarative manifests.

## Features

- Deploy targets from `infrastructure/hosts.yml` (single source of truth)
- App manifest format (`fastpluggy.json`) → generates Dockerfile, main.py, docker-compose.yml
- Production-grade: Sentry, CORS, health checks, worker optimization
- Plugin infra requirements in `pyproject.toml` under `[tool.fastpluggy.deploy]`
- Deploy wizard UI with service resolution (new/existing modes)
- Auto-suggest shared services from hosts.yml
- App lifecycle management (status, logs, update, remove)
- Deployment history persisted in SQLite

## Install

```bash
pip install fastpluggy-fp-deployer
```

## Quick Start

1. Set `infra_repo_path` to your infrastructure repo directory:
   ```bash
   export infra_repo_path=/path/to/infrastructure/
   ```
2. Restart the dev server
3. Navigate to **Deployer** in the sidebar

## Plugin source: local checkout or registry

The wizard's plugin list / deploy-manifest data comes from one of two
sources, chosen automatically:

- **Local** — if `ECOSYSTEM_ROOT/plugins` exists, scan it (author/dev
  workflow; full source checkout).
- **Registry** (default, zero-config) — otherwise read manifests from a
  PyPI Simple index (`registry_url`, default
  `https://registry.fastpluggy.xyz`). Per package the latest sdist is
  fetched and its `[tool.fastpluggy.deploy]` read (sdist-only; no JSON
  API). **Offline-safe:** cache-first with TTL
  (`registry_manifest_ttl`, default 1h), falling back to a stale cache
  when the registry is unreachable, then to an empty list — never
  blocks the wizard. Cache at `registry_cache_path` (default
  `~/.cache/fp-deployer/registry_manifests.json`; point it at a
  persistent volume in containers).

This removes the need for a 40-submodule ecosystem clone just to
populate the wizard. Deploys themselves were already registry-driven
(plugins `pip install`ed by name from `registry_url`).

## Pages

| Route | Description |
|-------|-------------|
| `/plugin-pkg/fp_deployer/` | Deployed apps (home) |
| `/plugin-pkg/fp_deployer/targets` | Deploy targets from hosts.yml |
| `/plugin-pkg/fp_deployer/new` | Deploy wizard |

## Documentation

- [docs/deployer.md](docs/deployer.md) — full usage guide (manifest format, deploy config, API, hosts.yml)
- [docs/service-resolution.md](docs/service-resolution.md) — service resolution modes (new/existing), env merge, secret refs, wizard UI
