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
- 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
License
Release files for gcip2 0.1.3
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.1.3.tar.gz | 89.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gcip2-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 140.0 kB
Release files / gcip2-0.1.3.tar.gz
| Download URL | gcip2-0.1.3.tar.gz |
|---|---|
| Size | 89.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6c2d1f824c4f0c002fcc3f1e4a1bbc224aad536bdd70df1462b9278b4a405fd
|
|
BLAKE2b-256 checksum How to use checksums |
fbc33457a30f709d2b12b1a77e1670dcfbbe9beb4b2cc781205a3c290a35ecc5
|
| 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.3-py3-none-any.whl
| Download URL | gcip2-0.1.3-py3-none-any.whl |
|---|---|
| Size | 50.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1e3e038498c2f744fa359514c18651e2366d46da6ce1c636f404eb6d7dbd87f
|
|
BLAKE2b-256 checksum How to use checksums |
4129012b9551363f3c7b333b92b4517cfa2f055ae494beb6664f65d31d1cfc55
|
| 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}
|