# on-prem






> Self-hosted infrastructure management and deployment automation platform
## table of contents
- [install](#install)
- [usage](#usage)
- [api](#api)
- [contributing](#contributing)
- [license](#license)
## install
```bash
pip install on-premor from source:
git clone https://github.com/yourusername/on-prem.git
cd on-prem
pip install -e .from onprem import Infrastructure, Deployment
# define your infrastructure
infra = Infrastructure.from_yaml("infra.yaml")
# deploy to target environment
deployment = Deployment(
infrastructure=infra,
environment="production",
strategy="rolling"
)
# execute deployment
result = deployment.run()
print(f"deployed {result.services_updated} services in {result.duration}s")example infra.yaml:
services:
- name: api
image: myapp/api:latest
replicas: 3
ports:
- 8080:80
- name: worker
image: myapp/worker:latest
replicas: 5Infrastructure.from_yaml(path: str) -> Infrastructure
Load infrastructure configuration from YAML file.
Infrastructure.from_dict(config: dict) -> Infrastructure
Create infrastructure from dictionary object.
Infrastructure.validate() -> bool
Validate configuration against schema.
Deployment(infrastructure, environment, strategy="rolling")
Create a deployment instance.
infrastructure: Infrastructure objectenvironment: target environment namestrategy: deployment strategy (rolling,blue-green,canary)
Deployment.run() -> DeploymentResult
Execute the deployment. Returns result object with status, duration, and metadata.
Deployment.rollback() -> bool
Rollback to previous deployment state.
Properties:
status: deployment status (success,failed,partial)services_updated: number of services successfully updatedduration: deployment duration in secondserrors: list of errors if any occurred
prs welcome. open an issue first for big changes.
run tests:
pytest tests/format code:
black onprem/MIT