Skip to content

EvgeniyPatlan/pipeline-builder

Repository files navigation

Pipeline Builder

Web UI, CLI, and interactive TUI for creating, editing, and generating Jenkins CI/CD pipeline files (Groovy + JJB YML).

Built for managing Percona's release build pipelines — parses existing pipelines into a structured model, lets you edit visually or from the command line, and generates valid pipeline code.

Quick Start

# Docker (web UI)
docker build -t pipeline-builder .
docker run -p 5000:5000 pipeline-builder
# Open http://localhost:5000

# Or install with pip
pip install .
pipeline-tui                            # interactive terminal UI
pipeline-cli show path/to/pipeline.groovy  # quick CLI commands
pipeline-builder-web                    # web UI on :5000

Installation

Option 1: pip (or pipx) from GitHub Release

pipx install https://github.com/EvgeniyPatlan/pipeline-builder/releases/download/v0.1.0/pipeline_builder-0.1.0-py3-none-any.whl

# Or with pip in a virtualenv
pip install https://github.com/EvgeniyPatlan/pipeline-builder/releases/download/v0.1.0/pipeline_builder-0.1.0-py3-none-any.whl

Option 2: pip install from source

git clone https://github.com/EvgeniyPatlan/pipeline-builder.git
cd pipeline-builder
pip install .

Option 3: Docker

# From GitHub Container Registry
docker run -p 5000:5000 ghcr.io/evgeniypatlan/pipeline-builder:latest

# Or build locally
git clone https://github.com/EvgeniyPatlan/pipeline-builder.git
cd pipeline-builder
docker build -t pipeline-builder .
docker run -p 5000:5000 pipeline-builder

Installed Commands

Command Description
pipeline-tui Interactive terminal UI with menus, editing, and save
pipeline-cli Non-interactive CLI for scripting and one-off commands
pipeline-builder-web Starts the web UI on http://localhost:5000

Requirements

  • Python 3.10+
  • git (must be in PATH)

Interactive TUI

The TUI provides a full interactive terminal interface for browsing, editing, and saving pipelines.

# Launch TUI
pipeline-tui

# Open a file directly
pipeline-tui /path/to/pipeline.groovy

# Open a repo directory (goes to browser)
pipeline-tui /path/to/jenkins-pipelines/

TUI Main Menu

  Pipeline Builder — Interactive TUI

  1. Edit current pipeline
  2. Open pipeline file
  3. Browse repo directory
  4. Create new pipeline
  0. Quit

TUI Features

  • Browse repo — paginated file list with type detection, release builds shown first
  • Edit product info — name, version, display name
  • Edit parameters — add, remove, edit parameters interactively
  • Edit OS targets — add single target, add both architectures at once, remove, toggle enable/disable
  • Edit post-build stages — toggle upload/sign/push/tarballs/tests/docker with config prompts
  • Edit builder config — script name, fetch method, FIPS mode
  • Edit Slack config — channel, notification toggles
  • Preview — paginated Groovy and YML preview
  • Save — save to current file or save-as to a new path, optionally generates both Groovy + YML
  • Unsaved changes tracking — warns before quitting with unsaved edits

Quick Add: OS for Both Architectures

From the OS targets menu, option "Quick add" creates both x86_64 and aarch64 targets at once:

  OS name: Oracle Linux 11
  Docker image: oraclelinux:11
  Build type: rpm

  Added: Oracle Linux 11 (x86_64 + aarch64)

CLI Usage

Non-interactive commands for scripting and automation.

List pipelines in a repo

pipeline-cli list /path/to/jenkins-pipelines --detect
── Release Build Pipelines (99) ──
  psmdb/jenkins/percona-server-for-mongodb-8.0.groovy           100%
  rel/jenkins/valkey.groovy                                      96%
  ...

── Other (410) ──
  psmdb/psmdb-parallel.groovy                                    unknown
  ...

Show pipeline summary

pipeline-cli show /path/to/valkey.groovy
Type:       release_build
Product:    Valkey 9.0.3
Builder:    valkey_builder.sh (git_clone)
FIPS:       no

Parameters (7):
  CLOUD                     choice    [Hetzner,AWS]  default=Hetzner
  ...

Build Matrix (20 enabled, 0 disabled):
  RPM: 8  DEB: 12  Tarball: 0
  [ ] Oracle Linux 8                      oraclelinux:8        x86_64   rpm
  ...

Full JSON: pipeline-cli show /path/to/valkey.groovy --json

List OS build targets

pipeline-cli list-os /path/to/valkey.groovy

Add / remove OS targets

# Add a target (overwrites file in place)
pipeline-cli add-os /path/to/pipeline.groovy \
  --name "Oracle Linux 11" --image oraclelinux:11 --arch x86_64 --type rpm

# Preview to stdout (no file changes)
pipeline-cli add-os /path/to/pipeline.groovy \
  --name "Oracle Linux 11" --image oraclelinux:11 --arch x86_64 --type rpm -o -

# Write to new file
pipeline-cli add-os /path/to/pipeline.groovy \
  --name "Oracle Linux 11" --image oraclelinux:11 --arch x86_64 --type rpm -o updated.groovy

# Remove
pipeline-cli remove-os /path/to/pipeline.groovy --name "Debian Bullseye(11)"

Add / remove parameters

# Choice parameter
pipeline-cli add-param /path/to/pipeline.groovy \
  --name FIPSMODE --param-type choice --choices "yes,no" --default no

# String parameter
pipeline-cli add-param /path/to/pipeline.groovy \
  --name CUSTOM_FLAG --param-type string --default "value" --description "My flag"

# Remove
pipeline-cli remove-param /path/to/pipeline.groovy --name FIPSMODE

Enable / disable stages

pipeline-cli enable-stage /path/to/pipeline.groovy --stage push_tarballs
pipeline-cli disable-stage /path/to/pipeline.groovy --stage docker_build

Stages: upload, sign, push_repo, push_tarballs, run_tests, docker_build

Generate / create / diff

# Regenerate Groovy
pipeline-cli generate /path/to/pipeline.groovy -o output.groovy

# Generate YML
pipeline-cli generate-yml /path/to/pipeline.groovy -o output.yml

# New pipeline from scratch
pipeline-cli new --type release_build -o my-pipeline.groovy

# Show diff between original and generated
pipeline-cli diff /path/to/pipeline.groovy

Output Behavior (CLI)

Flag Behavior
(no flag) Overwrites the input file in place
-o path Writes to the specified file
-o - Prints to stdout (no files modified)

Web UI Usage

pipeline-builder-web                     # after pip install
# or
docker run -p 5000:5000 pipeline-builder # Docker

Open http://localhost:5000:

  1. Enter a git repo URL and click Clone
  2. Browse pipeline files — release builds shown first with confidence scores
  3. Click a file to parse and edit
  4. Edit using three views:
    • Form — structured form with all sections
    • Blocks — visual pipeline stage blocks
    • Code — side-by-side form + live Groovy/YML preview
  5. Click Download to get generated files

Docker Compose

version: '3.8'
services:
  pipeline-builder:
    image: ghcr.io/evgeniypatlan/pipeline-builder:latest
    ports:
      - "5000:5000"
    volumes:
      - repo-cache:/tmp/repos
    restart: unless-stopped

volumes:
  repo-cache:

Supported Pipeline Types

Type Status Description
release_build Implemented Source tarball, RPM/DEB packages, binary tarballs, signing, repo push
molecule_test Planned Molecule-based infrastructure testing pipelines

Creating a Release

# Update version in pyproject.toml, then:
git tag v0.2.0
git push origin main v0.2.0

The GitHub Action will:

  1. Build pip package (wheel + sdist)
  2. Create GitHub Release with packages attached
  3. Build and push Docker image to ghcr.io

Architecture

See docs/ARCHITECTURE.md for detailed architecture documentation including diagrams, data flows, module descriptions, and the plugin system.

About

Pipeline Builder is a Dockerized web tool for creating, editing, and generating Jenkins CI/CD pipeline definitions (Groovy + JJB YML files). It is designed for Percona’s release build system, where ~50 pipelines follow the same structural template with product-specific variations.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors