Skip to content

2aronS/on-prem

Repository files navigation

# on-prem

![license](https://img.shields.io/badge/license-MIT-blue)
![status](https://img.shields.io/badge/status-active-brightgreen)
![python](https://img.shields.io/badge/python-3.9+-blue)
![build](https://img.shields.io/badge/build-passing-brightgreen)
![coverage](https://img.shields.io/badge/coverage-87%25-green)
![code style](https://img.shields.io/badge/code%20style-black-black)

> 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-prem

or from source:

git clone https://github.com/yourusername/on-prem.git
cd on-prem
pip install -e .

usage

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: 5

api

Infrastructure

Infrastructure.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

Deployment(infrastructure, environment, strategy="rolling")

Create a deployment instance.

  • infrastructure: Infrastructure object
  • environment: target environment name
  • strategy: 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.

DeploymentResult

Properties:

  • status: deployment status (success, failed, partial)
  • services_updated: number of services successfully updated
  • duration: deployment duration in seconds
  • errors: list of errors if any occurred

contributing

prs welcome. open an issue first for big changes.

run tests:

pytest tests/

format code:

black onprem/

license

MIT

About

Self-hosted infrastructure management and deployment automation platform

Topics

Resources

License

Stars

6 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors