Skip to main content

GCIP2

GCIP2 is a Python DSL for building GitLab CI/CD pipelines using strongly typed Pydantic models and a fluent builder API.

Instead of writing large YAML files, pipelines are defined in Python, validated against the official GitLab CI schema, and rendered into GitLab-compatible YAML.

Features

  • Strongly typed GitLab CI models
  • Fluent builder API
  • Reusable job builders
  • Pipeline inheritance
  • JSON Schema validation
  • Automatic YAML generation
  • Dynamic pipeline discovery
  • GitLab-compatible output

Installation

Create pyproject.toml with pyproject configuration

[project]
name = "dev"
version = "0.0.0"
description = ""
requires-python = ">=3.11,<4.0"

uv add gcip2

Quick Start

Initialize a new project:

gcip2 init

This generates a minimal project structure:

.
├── ci.py
├── pyproject.toml
├── environment.toml
└── .pre-commit-config.yaml

Generate a child pipeline:

gcip2 build-pipeline

or explicitly:

gcip2 build-pipeline \
    --ci-file ci.py \
    --out-pipeline out/pipeline.gitlab-ci.yml

Generate the root .gitlab-ci.yml:

gcip2 build-gitlab-ci

or

gcip2 build-gitlab-ci \
    --ci-file ci.py \
    --out-gitlab-ci .gitlab-ci.yml

Documentation

Detailed documentation is available in the docs/ directory.

Document Description
docs/pipeline.md Creating pipelines, jobs and workflow configuration
docs/builder.md Pipeline builder, rendering and YAML generation
docs/pipeline_core.md Reference for the typed GitLab CI models
docs/secrets.md SecretsHandler with Vault integration
docs/project_config.md ProjectConfig with global environment
CHANGELOG.md Project changelog

Project Structure

A typical project consists of two builders:

ci.py
 ├── Pipeline(PipelineBuilderImpl)
 │      └── generates:
 │          out/pipeline.gitlab-ci.yml
 │
 └── GitlabCi(GitlabCiBuilderImpl)
        └── generates:
            .gitlab-ci.yml

Pipeline defines the reusable downstream pipeline, while GitlabCi defines the repository's root GitLab CI configuration.


CLI

Initialize a project:

gcip2 init

Force regeneration of template files:

gcip2 init --force

Build a child pipeline:

gcip2 build-pipeline

Build the repository .gitlab-ci.yml:

gcip2 build-gitlab-ci

Validation

Generated pipelines can be validated against the bundled GitLab JSON schema before rendering.


External Links


License

https://gl.pivlab.space/rnd/gcip2/-/blob/master/LICENCE.md

Release files for gcip2 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gcip2 0.1.0
File Size Uploaded
gcip2-0.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcip2 0.1.0
File Interpreter ABI Platform
gcip2-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / gcip2-0.1.0.tar.gz

Download URL gcip2-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fe7ac7c4793685d3dba20ae6a76b84bfe6c72fb1dc55757be7f93db46ca52514
BLAKE2b-256 checksum
How to use checksums
65a4434e513d5deeab36e533842059e53a0aa331ca6e26ebb8a7f448efa4bca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gcip2-0.1.0-py3-none-any.whl

Download URL gcip2-0.1.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef7d43beb7bfb32cbf27a9d07c3bbf4b0c8267bf96980904ad39b0e545a5dd52
BLAKE2b-256 checksum
How to use checksums
61f9bd69febf50a2d23fa7d069671b97ab9a8cd53fdc19c891b76a63770385eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page