Generic GitLab CI/CD
Define your projects and checks. Generate a reviewable GitLab pipeline.
Generic GitLab CI/CD is a Python toolkit that turns a small delivery configuration into a committed .gitlab-ci.yml. It connects your existing test commands, application builds, package publication, container builds, and Helm deployments while keeping infrastructure settings separate from application configuration.
The package is named generic-gitlab-cicd; the command is generic-ci. GitLab and your runners execute the generated pipeline. The CLI validates and generates configuration locally.
Quick start · Workflow guide · CLI reference · Examples · Documentation
One repository. Tests, packages, and deployment.
Keep your shared Python package and API together. Generic CI tests them, publishes the package on release, and deploys the API to OpenShift.
version: 1
projects:
sdk:
path: packages/sdk
python: {}
checks:
tests:
script: [uv run --no-sync pytest]
package:
index: internal
release:
tag: v{version}
workflows:
merge-request:
checks: [tests]
release:
checks: [tests]
publish: true
api:
path: services/api
depends-on: [sdk]
python: {}
checks:
tests:
script: [uv run --no-sync pytest]
container:
dockerfile: Dockerfile
release:
tag: v{version}
needs: [sdk]
workflows:
merge-request:
checks: [tests]
release:
checks: [tests]
build: [container]
deployments:
api:
target: production
chart:
path: deploy/chart
values: [deploy/values.yaml]
images:
- from: api.build-image
set:
repository: apps.api.image.repository
tag: apps.api.image.tag
workflows:
release:
when: manual
What you get:
- On merge requests: test affected projects. SDK changes also select the API for testing.
- On a release tag: run checks, publish the SDK, and build the API image. The API release depends on SDK publication; its tests and image build can run independently.
- When you approve deployment: deploy the built API image through Helm to OpenShift.
Both projects use a shared version: projects at 1.2.0 release under the protected tag v1.2.0. Dependency installation follows each project's declared dependencies and committed lockfile; depends-on selects work, not package replacements.
Your organization supplies prepared runtime images, registry settings, and the production target in ci-platform.yml. The application's deploy/chart and deploy/values.yaml describe the deployment. Start with the shared chart and values example; configure the named internal publishing index and CI credentials through your platform.
Quick start
Use Python 3.11 or newer. From a checkout of this toolkit, install the CLI into an isolated environment:
python -m venv .venv
. .venv/bin/activate
python -m pip install .
Then, from your application repository:
generic-ci setup
Setup guides you through organization templates or standalone configuration, previews files before writing, and includes local editor schemas. Start with its single-app configuration and add projects as needed, or choose an organization template for your monorepo. See the setup guide for prepared images, unattended options, and editor integration.
After editing your configuration:
generic-ci validate
generic-ci render -o .gitlab-ci.yml
Review and commit delivery.yml, your platform configuration, and the generated .gitlab-ci.yml together. Validate the generated pipeline with your GitLab CI Lint, then push your branch.
Prefer autocomplete? Setup exports the schemas automatically. You can also refresh them from the installed CLI:
generic-ci schema -o .generic-ci/delivery.schema.json
generic-ci schema --platform-schema -o .generic-ci/platform.schema.json
Associate them with delivery.yml and ci-platform.yml in your editor. The editor guide includes PyCharm instructions.
Add the delivery features you need
| Goal | Configuration / next step |
|---|---|
| Test Node, pnpm, or Bun projects | Declare node.package-manager, commit the corresponding lockfile, and use your existing commands; see the workflow guide |
| Build application artifacts | Set build.script and build.outputs; select build: [application] in the workflow |
| Retest downstream projects | Add project depends-on: [sdk]; this propagates change selection |
| Transfer generated files to another job | Add check/build needs: [sdk.build]; the producer must be enabled in the same event |
| Build and push containers | Configure container and select build: [container]; the default builder is Buildah |
| Publish Python or npm-compatible packages | Configure package and workflow publish; see publication behavior |
| Coordinate releases | Configure project versions, tag conventions, and optional release.needs; see the release workflow |
| Deploy to OpenShift | Configure a Helm deployment, target, values, and image bindings; start with the deployment example and chart values |
depends-on and needs have different jobs: the first selects affected projects; the second transfers explicit same-event outputs. Neither implicitly installs an unreleased package. Candidate dependency testing has a separate contract described in the workflow guide.
Share organization defaults
An organization source can provide platform defaults and starter templates. Initialize from a reviewed source revision:
generic-ci init --repo ssh://git@gitlab.example.internal/platform/ci-config.git \
--ref v1.0.0 --template python-service
The repository, ref, and template name above are examples; the source must contain the toolkit's source manifest. Initialization copies starter files and records an exact source commit. Commit the resulting descriptor and lockfile. Later source updates change inherited defaults while preserving consumer-owned template files.
For disconnected authoring, cache the locked source or import a Git bundle, then render with --offline. This flag controls configuration-source acquisition; it does not enforce network isolation inside application jobs. See configuration sources for source layout, registration, updates, and offline setup.
OpenShift deployment
The bundled generic-app chart supports multiple applications, Services, OpenShift Routes with TLS, probes, resources, ports, volumes/mounts, and pod labels/annotations. Images use repository + tag; Buildah also records the pushed digest as evidence. Security contexts are configurable, with cluster defaults applying when unset.
Helm deployments support complete updates and partial updates that preserve unchanged service images. Partial updates require a compatible existing baseline; chart or configuration changes require a complete deployment. Production requires a protected ref, and candidate dependency runs cannot update persistent deployments.
You supply registry credentials, CA trust, a kubeconfig, namespace resources, and application values. The toolkit does not provision the cluster, issue certificates, create PVCs automatically, or make multi-project publication transactional. Keep release image tags immutable: the shared chart uses IfNotPresent.
Existing component users
The repository also contains low-level GitLab CI/CD components and the older compiler, available through --format legacy. They are separate interfaces from the workflow configuration above. New users should start with the CLI walkthrough.
Mirror components into your GitLab instance and pin includes to an immutable revision. Consult the component air-gap guide for setup. Older BuildKit/digest-only Helm adapters target chart 1.x; the current chart uses OpenShift Routes and repository/tag values. Do not mix those contracts without migrating the configuration.
Development and validation
From a toolkit checkout with Python, Git, Node/npm, rsync, and Helm available:
python -m pip install . build twine uv setuptools
npm ci --ignore-scripts --no-audit --no-fund
python scripts/sync_embedded.py --check
python scripts/sync_authoring_skill.py --check
python -m unittest discover -s tests -v
npm run test:ci-local
The local pipeline fixtures use pinned gitlab-ci-local. Real GitLab/Runner E2E runs are deliberate, through workflow dispatch or an opt-in PR label. Use focused tests while iterating; see testing commands and evidence for prerequisites, integration tests, release checks, and scenario selection.
Version 0.3.2 passed fast CI and six real GitLab E2E scenarios. That evidence covers the tested pipeline fixtures, not deployment to your registry or OpenShift cluster. Qualify Buildah execution, registry access, Route admission, and rollout/rollback on your infrastructure before production use. Workflow runtime execution currently targets Linux; Windows workflow execution is not supported.
Documentation
Metadata
Release files for generic-gitlab-cicd 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| generic_gitlab_cicd-0.3.4.tar.gz | 73.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| generic_gitlab_cicd-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 136.6 kB
Release files / generic_gitlab_cicd-0.3.4.tar.gz
| Download URL | generic_gitlab_cicd-0.3.4.tar.gz |
|---|---|
| Size | 73.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af95482f1fa13ad1a9b8bf4b969f888d0cdae740f5cfad2e23cf51ace6e4511c
|
|
BLAKE2b-256 checksum How to use checksums |
2dd466332696a7a6f4bdda5a44cd85fd52fa252657789527767a129c9f31ef8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logRelease files / generic_gitlab_cicd-0.3.4-py3-none-any.whl
| Download URL | generic_gitlab_cicd-0.3.4-py3-none-any.whl |
|---|---|
| Size | 62.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f93a316efac5a3ae380e1711cd9c58ebd849ba6102fdff8e70610260aa66f1b6
|
|
BLAKE2b-256 checksum How to use checksums |
3ba957ab7086874e1e4b259188ee07e7d6741c8f8903ce9739c11221bacb80d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logSecurity for generic-gitlab-cicd 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for generic_gitlab_cicd-0.3.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.