How I built a CLI tool that generates its own infrastructure configs, manages a full containerised stack, enforces deployment policies through OPA, exposes Prometheus metrics, and produces a live audit trail — all from a single YAML file.
Table of Contents
The Problem We're Solving
Architecture Overview
Stage 4A — The Engine
The Manifest
The Python HTTP Service
The Dockerfile
The Templates
The CLI
The Two Deployment Modes
Stage 4B — The Eyes and Brain
Prometheus Metrics
OPA Policy Engine
Gated Lifecycle
The Status Dashboard
The Audit Trail
The Debugging Sagas
Full Deployment Walkthrough
Key Lessons Learned
The Problem We're Solving {#the-problem}
Every time you spin up a new service in a real DevOps environment, you repeat the same manual work:
Write an Nginx config
Write a Docker Compose file
Run Docker commands
Check if things are healthy
Hope nobody deploys when the disk is full
Hope nobody promotes a canary that's throwing 60% errors
SwiftDeploy solves all of this.…