Generate production-ready CI/CD pipeline configs for GitHub Actions, Azure DevOps, and GitLab CI from a simple YAML spec.
Project description
๐ pipeline-generator
Generate production-ready CI/CD pipeline configs from a simple YAML spec.
One spec file โ pipeline configs for GitHub Actions, Azure DevOps, and GitLab CI. Stop writing boilerplate YAML manually.
pipe-gen generate --demo
โจ Features
| Feature | Description |
|---|---|
| ๐ GitHub Actions | Generates .github/workflows/ci.yml with matrix testing, caching, Docker builds |
| ๐ท Azure DevOps | Generates azure-pipelines.yml with stages, test publishing, deployment jobs |
| ๐ฆ GitLab CI | Generates .gitlab-ci.yml with parallel matrix, DinD builds, environments |
| ๐ Auto-Detect | Scans your project to detect language, framework, and existing CI configs |
| ๐ Simple Spec | Define your pipeline in a human-readable YAML spec file |
| ๐จ Rich Output | Beautiful terminal output with previews, syntax highlighting, and summaries |
| ๐๏ธ 5 Languages | Python, Node.js, Go, .NET, Terraform โ with smart defaults for each |
| ๐ Security | Built-in security scanning stages (Bandit, Safety, npm audit, gosec, tfsec) |
| ๐ณ Docker | Docker build & push with metadata extraction and multi-platform support |
| ๐ Deploy | Environment-based deployments with manual approval gates |
๐ฆ Installation
pip install pipeline-generator
Or install from source:
git clone https://github.com/SanjaySundarMurthy/pipeline-generator.git
cd pipeline-generator
pip install -e ".[dev]"
๐ Quick Start
1. Create a spec file
# From a preset
pipe-gen init --preset python --name my-api
# Or auto-detect your project
pipe-gen detect
2. Edit the spec (optional)
# pipeline.yaml
project:
name: my-api
language: python
version: "3.11"
framework: fastapi
stages:
- lint
- test
- security
- build
- deploy
lint:
tools:
- ruff
test:
framework: pytest
coverage: true
min_coverage: 80
security:
tools:
- bandit
- safety
build:
type: docker
dockerfile: Dockerfile
registry: ghcr.io
deploy:
target: kubernetes
environments:
- name: staging
auto_deploy: true
- name: production
auto_deploy: false
3. Generate pipeline configs
# Generate for all platforms
pipe-gen generate --platform all
# Generate for a specific platform
pipe-gen generate --platform github
# Preview without writing files
pipe-gen generate --dry-run
# Try the demo (no files needed)
pipe-gen generate --demo
๐ CLI Reference
| Command | Description |
|---|---|
pipe-gen init |
Create a pipeline.yaml spec file |
pipe-gen detect |
Auto-detect project type |
pipe-gen generate |
Generate CI/CD pipeline configs |
pipe-gen --version |
Show version |
pipe-gen init
Options:
-p, --preset Language preset (python, node, go, dotnet, terraform)
-n, --name Project name
-o, --output Output file path (default: pipeline.yaml)
pipe-gen generate
Options:
-p, --platform Target platform: all, github, azure, gitlab (default: all)
-s, --spec Path to spec file (default: pipeline.yaml)
--preset Use a built-in preset instead of spec file
-o, --output-dir Output directory (default: current dir)
--dry-run Preview without writing files
--demo Demo mode with sample output
๐ฃ๏ธ Supported Languages
| Language | Lint Tools | Test Framework | Security Tools | Setup Action |
|---|---|---|---|---|
| Python | ruff, mypy, flake8, black | pytest, unittest | bandit, safety | setup-python@v5 |
| Node.js | eslint, prettier | jest, vitest, mocha | npm audit | setup-node@v4 |
| Go | golangci-lint, go vet | go test | gosec, govulncheck | setup-go@v5 |
| .NET | dotnet format | dotnet test | dotnet audit | setup-dotnet@v4 |
| Terraform | terraform fmt, tflint | terraform validate | tfsec, checkov | setup-terraform@v3 |
๐๏ธ Generated Pipeline Structure
Each generated pipeline includes (based on your spec):
lint โ test (matrix) โ security โ build (Docker) โ deploy
โโโ staging (auto)
โโโ production (manual)
What's included:
- Lint: Code style checking, formatting validation
- Test: Matrix testing across language versions, coverage reports
- Security: SAST scanning, dependency vulnerability checks
- Build: Docker build & push with image metadata and tagging
- Deploy: Environment-based deployments with approval gates
๐ง Advanced Usage
Use a preset without a spec file
pipe-gen generate --preset python --platform github --dry-run
Generate in a different directory
pipe-gen generate --output-dir ./ci-configs
Auto-detect and generate
pipe-gen detect # See what's detected
pipe-gen init # Create spec from detection
pipe-gen generate # Generate configs
๐งช Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest -v
# Run with coverage
pytest --cov=pipeline_generator -v
๐ Project Structure
pipeline-generator/
โโโ pipeline_generator/
โ โโโ __init__.py # Package version
โ โโโ cli.py # Click CLI commands
โ โโโ models.py # PipelineSpec data models
โ โโโ presets.py # Language configs & presets
โ โโโ detector.py # Project auto-detection
โ โโโ generator.py # Generation engine
โ โโโ platforms/
โ โ โโโ base.py # Abstract base class
โ โ โโโ github.py # GitHub Actions generator
โ โ โโโ azure.py # Azure DevOps generator
โ โ โโโ gitlab.py # GitLab CI generator
โ โโโ output/
โ โโโ console.py # Rich terminal output
โโโ tests/
โ โโโ conftest.py # Test fixtures
โ โโโ test_generator.py # 35+ tests
โโโ examples/ # Example spec files
โโโ pyproject.toml
โโโ README.md
โโโ CONTRIBUTING.md
๐ค Contributing
Contributions are welcome! See CONTRIBUTING.md for details.
Adding a new language
- Add tool config to
presets.pyโLANGUAGE_TOOLS - Add preset to
PRESETS - Add detection in
detector.py - Add tests and an example spec
Adding a new platform
- Create generator in
platforms/ - Inherit from
BasePlatform - Register in
generator.pyโPLATFORMS
๐ License
MIT License โ see LICENSE for details.
๐ค Author
Sanjay S โ Senior DevOps Engineer
- GitHub: @SanjaySundarMurthy
- LinkedIn: sanjaysundarmurthy
- Portfolio: sanjaysundarmurthy-portfolio.vercel.app
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cicd_pipeline_generator-1.0.0.tar.gz.
File metadata
- Download URL: cicd_pipeline_generator-1.0.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a4bf976a87e55239b8febeb3bc3f4e961c7d21f4a4631133ae1917b24b3e492
|
|
| MD5 |
ef2fadf8305f2a179a432b2190cc497c
|
|
| BLAKE2b-256 |
8b3594421d9e9ce1695db0bf677fe2400928fae11c39c87c7ed2ff08d11d64d6
|
File details
Details for the file cicd_pipeline_generator-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cicd_pipeline_generator-1.0.0-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9282503a67c839f854afc11c50c48b528210e6d2a367c9a37e212f496526d7a
|
|
| MD5 |
7f0090835566f2be682b24bebc177772
|
|
| BLAKE2b-256 |
3c0645d7162248652be8d9bb02771ade80cb433dca5d7faa21d7ef6bcdeeb61f
|