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:
dothat run init
This generates a minimal project structure:
.
├── ci.py
├── pyproject.toml
├── environment.toml
└── .pre-commit-config.yaml
Generate a child pipeline:
dothat run build-pipeline
or explicitly:
dothat run build-pipeline \
--ci-file ci.py \
--out-pipeline out/pipeline.gitlab-ci.yml
Generate the root .gitlab-ci.yml:
dothat run build-gitlab-ci
or
dothat run build-gitlab-ci \
--ci-file ci.py \
--out-gitlab-ci .gitlab-ci.yml
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.
Validation
Generated pipelines can be validated against the bundled GitLab JSON schema before rendering.
External Links
- JSON Schema: https://json-schema.org/draft-07/json-schema-release-notes#keywords
- GitLab Pipeline Schema: https://gitlab.com/gitlab-org/gitlab-foss/-/raw/master/app/assets/javascripts/editor/schema/ci.json
- GitLab CI Documentation: https://docs.gitlab.com/ci/pipeline_editor/#view-full-configuration
Release files for gcip2 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gcip2-0.2.2.tar.gz | 178.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcip2-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 239.2 kB
Release files / gcip2-0.2.2.tar.gz
| Download URL | gcip2-0.2.2.tar.gz |
|---|---|
| Size | 178.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60fb14e6797bee4fd57d3f1351d18afa3f6304b434b704eb0a1829e09eddfac3
|
|
BLAKE2b-256 checksum How to use checksums |
e2be8e89283c0d396cf56226aed08d375d41f9b29648cc2785608b3a44b9e3c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / gcip2-0.2.2-py3-none-any.whl
| Download URL | gcip2-0.2.2-py3-none-any.whl |
|---|---|
| Size | 61.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b89ae10a89969ab4b231bfccf5113bdafe46fd223879e6025b50c305facec1e4
|
|
BLAKE2b-256 checksum How to use checksums |
ca6bd9fb4d27fb05e923b2195f4d2ea0db669599f1bbd123f4429527d2e8dd2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|