Skip to main content

Generate production-ready CI/CD pipeline configs for GitHub Actions, Azure DevOps, and GitLab CI from a simple YAML spec.

Project description

๐Ÿš€ pipeline-generator

CI Python 3.9+ License: MIT

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

  1. Add tool config to presets.py โ†’ LANGUAGE_TOOLS
  2. Add preset to PRESETS
  3. Add detection in detector.py
  4. Add tests and an example spec

Adding a new platform

  1. Create generator in platforms/
  2. Inherit from BasePlatform
  3. Register in generator.py โ†’ PLATFORMS

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.

๐Ÿ‘ค Author

Sanjay S โ€” Senior DevOps Engineer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cicd_pipeline_generator-1.0.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cicd_pipeline_generator-1.0.0-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

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

Hashes for cicd_pipeline_generator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6a4bf976a87e55239b8febeb3bc3f4e961c7d21f4a4631133ae1917b24b3e492
MD5 ef2fadf8305f2a179a432b2190cc497c
BLAKE2b-256 8b3594421d9e9ce1695db0bf677fe2400928fae11c39c87c7ed2ff08d11d64d6

See more details on using hashes here.

File details

Details for the file cicd_pipeline_generator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cicd_pipeline_generator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9282503a67c839f854afc11c50c48b528210e6d2a367c9a37e212f496526d7a
MD5 7f0090835566f2be682b24bebc177772
BLAKE2b-256 3c0645d7162248652be8d9bb02771ade80cb433dca5d7faa21d7ef6bcdeeb61f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page