generic-gitlab-cicd 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. generic_gitlab_cicd-0.3.3/PKG-INFO +212 -0
  2. generic_gitlab_cicd-0.3.3/README.md +201 -0
  3. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/__init__.py +1 -1
  4. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/cli.py +8 -1
  5. generic_gitlab_cicd-0.3.3/generic_ci/setup.py +209 -0
  6. generic_gitlab_cicd-0.3.3/generic_gitlab_cicd.egg-info/PKG-INFO +212 -0
  7. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_gitlab_cicd.egg-info/SOURCES.txt +2 -0
  8. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/pyproject.toml +1 -1
  9. generic_gitlab_cicd-0.3.3/tests/test_setup.py +64 -0
  10. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_sources.py +10 -0
  11. generic_gitlab_cicd-0.3.2/PKG-INFO +0 -170
  12. generic_gitlab_cicd-0.3.2/README.md +0 -159
  13. generic_gitlab_cicd-0.3.2/generic_gitlab_cicd.egg-info/PKG-INFO +0 -170
  14. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/__main__.py +0 -0
  15. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/compiler.py +0 -0
  16. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/config.py +0 -0
  17. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/dependencies.py +0 -0
  18. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/models.py +0 -0
  19. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/runtime.py +0 -0
  20. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/sources.py +0 -0
  21. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/__init__.py +0 -0
  22. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/compiler.py +0 -0
  23. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/ecosystems.py +0 -0
  24. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/helm.py +0 -0
  25. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/models.py +0 -0
  26. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/publication.py +0 -0
  27. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_ci/workflows/runtime.py +0 -0
  28. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_gitlab_cicd.egg-info/dependency_links.txt +0 -0
  29. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_gitlab_cicd.egg-info/entry_points.txt +0 -0
  30. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_gitlab_cicd.egg-info/requires.txt +0 -0
  31. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/generic_gitlab_cicd.egg-info/top_level.txt +0 -0
  32. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/setup.cfg +0 -0
  33. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_chart.py +0 -0
  34. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_framework.py +0 -0
  35. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_product.py +0 -0
  36. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_publication.py +0 -0
  37. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_review.py +0 -0
  38. {generic_gitlab_cicd-0.3.2 → generic_gitlab_cicd-0.3.3}/tests/test_workflows.py +0 -0
@@ -0,0 +1,212 @@
1
+ Metadata-Version: 2.4
2
+ Name: generic-gitlab-cicd
3
+ Version: 0.3.3
4
+ Summary: Validated project configuration and reproducible GitLab delivery pipelines
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: pydantic<3,>=2.10
8
+ Requires-Dist: PyYAML<7,>=6
9
+ Requires-Dist: tomlkit<1,>=0.13
10
+ Requires-Dist: packaging<27,>=25
11
+
12
+ # Generic GitLab CI/CD
13
+
14
+ **Define your projects and checks. Generate a reviewable GitLab pipeline.**
15
+
16
+ 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.
17
+
18
+ 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.
19
+
20
+ [Quick start](#quick-start) · [Workflow guide](docs/workflows-revision-one.md) · [CLI reference](docs/cli-reference.md) · [Examples](examples/workflows) · [Documentation](docs/README.md)
21
+
22
+ ## Why use it?
23
+
24
+ Use this toolkit when several services or repositories share delivery conventions, but each team needs to choose its own checks and release behavior.
25
+
26
+ - **Keep application intent readable.** Name your checks and select them for pushes, merge requests, releases, manual pipelines, or schedules. The toolkit does not insert an assumed test suite.
27
+ - **Reuse platform configuration.** Share runner tags, prepared images, registries, and deployment targets through organization defaults and Git-backed templates.
28
+ - **Connect monorepo work explicitly.** Declare which projects are affected by upstream changes and which jobs need upstream artifacts. Artifact receipts verify the producing commit, pipeline, configuration, and file checksums.
29
+ - **Support internal infrastructure.** Use prepared runtime images, internal package services, and cached configuration sources. Consumer jobs have no automatic public toolkit bootstrap.
30
+ - **Review generated changes before execution.** Commit the generated YAML alongside its inputs; validate configuration and detect generation drift locally or in CI.
31
+
32
+ For a repository with a few standalone jobs, handwritten GitLab CI may be sufficient. This toolkit is most useful when repeated release, dependency, and deployment rules are becoming difficult to maintain consistently.
33
+
34
+ ## How it works
35
+
36
+ | File | What belongs here |
37
+ | --- | --- |
38
+ | `delivery.yml` | Projects, commands, workflow selection, builds, and deployments |
39
+ | `ci-platform.yml` | Runtime images, runner tags, registry locations, and deployment targets |
40
+ | `.gitlab-ci.yml` | Generated pipeline; regenerate after editing the inputs |
41
+ | `generic-ci.yml` + `generic-ci.lock.json` | Optional organization source configuration and its pinned commit |
42
+
43
+ Run `generic-ci validate`, inspect `generic-ci explain`, then run `generic-ci render`. Commit the inputs and generated pipeline together. GitLab executes a planner and the selected runtime jobs using your prepared images.
44
+
45
+ ## Quick start
46
+
47
+ Install the CLI as shown below, then run **`generic-ci setup`** from your application repository. It walks you through organization templates or standalone configuration, validates the result, and previews files before writing. It never overwrites existing files or installs a pre-commit hook.
48
+
49
+ ```sh
50
+ generic-ci setup
51
+ ```
52
+
53
+ Organization mode asks for a Git configuration repository (GitHub or GitLab), revision, template, and application settings. Standalone mode detects the ecosystem, asks for your existing test command and runtime infrastructure, and optionally creates a manual OpenShift MR preview with `deploy/values.yaml`. The chart must already be published and compatible with generic-app 2.x; setup does not provision infrastructure.
54
+
55
+ Both paths write the generated pipeline, setup notes, and local editor schemas. See [setup and editor integration](docs/setup-revision-one.md) for unattended flags, dry runs, schema mappings, and limitations.
56
+
57
+ The following manual walkthrough explains the files setup produces and remains useful when editing an existing configuration.
58
+
59
+ This example adds push and merge-request tests to an **existing Python project**. It assumes the repository already has a `pyproject.toml`, a committed `uv.lock`, and pytest declared in a dependency group. Replace the test command if your project uses something else.
60
+
61
+ ### 1. Install the CLI
62
+
63
+ Use Python **3.11 or newer**. From a checkout of this repository, install into an isolated environment:
64
+
65
+ ```sh
66
+ python -m venv .venv
67
+ . .venv/bin/activate
68
+ python -m pip install .
69
+ generic-ci --help
70
+ ```
71
+
72
+ For repeatable organization setup, distribute a versioned wheel through your approved internal package index or wheelhouse. Keep the authoring CLI and the toolkit installed in runner images on the **same version**. This source revision is **0.3.3**; source availability does not imply that version has been published to PyPI.
73
+
74
+ The install command uses your configured package sources. In an air-gapped environment, prepare the wheel and all dependencies internally first.
75
+
76
+ ### 2. Provide the runtime configuration
77
+
78
+ In your **application repository**, create `ci-platform.yml`:
79
+
80
+ ```yaml
81
+ version: 1
82
+ defaults:
83
+ tags: [internal-linux]
84
+ images:
85
+ python: registry.example.internal/ci/python-toolkit:0.3.3
86
+ container-builder:
87
+ engine: buildah
88
+ image: registry.example.internal/ci/buildah-toolkit:0.3.3
89
+ registries:
90
+ containers: registry.example.internal/apps
91
+ previews: registry.example.internal/previews
92
+ allowed-hosts:
93
+ - registry.example.internal
94
+ - gitlab.example.internal
95
+ variables:
96
+ UV_PYTHON_DOWNLOADS: never
97
+ ```
98
+
99
+ **Replace the example addresses and tags with your platform's values.** These images are placeholders, not publicly available toolkit images. The Python image needs Python, Git, uv, the matching toolkit, and your internal package/CA configuration. The builder image needs Buildah and the matching Python toolkit runtime. Builder and registry settings are required by the platform schema even though this test-only example does not build or push an image.
100
+
101
+ If your organization already provides a platform file or configuration source, use it. Platform maintainers can start with the [image-factory setup guide](starters/image-factory/CI-SETUP.md). Installing the CLI on your laptop does not prepare runner images.
102
+
103
+ ### 3. Define the checks
104
+
105
+ Create `delivery.yml` in the application repository:
106
+
107
+ ```yaml
108
+ version: 1
109
+ projects:
110
+ app:
111
+ path: .
112
+ python:
113
+ groups: all
114
+ checks:
115
+ unit:
116
+ script:
117
+ - uv run --no-sync pytest
118
+ workflows:
119
+ push:
120
+ checks: [unit]
121
+ merge-request:
122
+ checks: [unit]
123
+ ```
124
+
125
+ `path` is relative to the repository root. Commands run in that project directory. Python dependency preparation uses the committed lockfile; `--no-sync` prevents the test command from resynchronizing the environment. With `groups: all`, dependency groups must be mutually compatible.
126
+
127
+ This configuration selects `unit` for push and merge-request workflows. Push pipelines are suppressed when an open MR takes their place. It does not publish a package, build an image, or deploy an application.
128
+
129
+ ### 4. Validate, inspect, and generate
130
+
131
+ Run these commands from the application repository using the installed CLI:
132
+
133
+ ```sh
134
+ generic-ci validate
135
+ generic-ci explain -o ci-explain.json
136
+ generic-ci render -o .gitlab-ci.yml
137
+ generic-ci render --check -o .gitlab-ci.yml
138
+ ```
139
+
140
+ Review `ci-explain.json` and the generated jobs, then commit `delivery.yml`, `ci-platform.yml`, and `.gitlab-ci.yml`. The explanation file is optional diagnostic output.
141
+
142
+ Validate the generated YAML with **your GitLab CI Lint**, push the branch, and inspect the first pipeline. Local validation checks configuration and the job graph; it does not run pytest or check that a registry image exists. Your runner must match the configured tags and be able to pull the runtime image and reach the configured internal services.
143
+
144
+ After changing a command, platform setting, or source lock, render again. Use `generic-ci render --check -o .gitlab-ci.yml` in CI to detect stale generated YAML.
145
+
146
+ ## Add the delivery features you need
147
+
148
+ | Goal | Configuration / next step |
149
+ | --- | --- |
150
+ | Test Node, pnpm, or Bun projects | Declare `node.package-manager`, commit the corresponding lockfile, and use your existing commands; see the [workflow guide](docs/workflows-revision-one.md) |
151
+ | Build application artifacts | Set `build.script` and `build.outputs`; select `build: [application]` in the workflow |
152
+ | Retest downstream projects | Add project `depends-on: [sdk]`; this propagates change selection |
153
+ | Transfer generated files to another job | Add check/build `needs: [sdk.build]`; the producer must be enabled in the same event |
154
+ | Build and push containers | Configure `container` and select `build: [container]`; the default builder is Buildah |
155
+ | Publish Python or npm-compatible packages | Configure `package` and workflow `publish`; see [publication behavior](docs/workflows-revision-one.md#package-publication--revision-four) |
156
+ | Coordinate releases | Configure project versions, tag conventions, and optional `release.needs`; see the [release workflow](docs/workflows-revision-one.md#version-bumps-and-release-button) |
157
+ | Deploy to OpenShift | Configure a Helm deployment, target, values, and image bindings; start with the [deployment example](examples/workflows/delivery.yml) and [chart values](examples/helm-values.yaml) |
158
+
159
+ `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](docs/workflows-revision-one.md).
160
+
161
+ ## Share organization defaults
162
+
163
+ An organization source can provide platform defaults and starter templates. Initialize from a reviewed source revision:
164
+
165
+ ```sh
166
+ generic-ci init --repo ssh://git@gitlab.example.internal/platform/ci-config.git \
167
+ --ref v1.0.0 --template python-service
168
+ ```
169
+
170
+ 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.
171
+
172
+ 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](docs/configuration-sources-revision-two.md) for source layout, registration, updates, and offline setup.
173
+
174
+ ## OpenShift deployment
175
+
176
+ The bundled [generic-app chart](charts/generic-app) 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.
177
+
178
+ 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.
179
+
180
+ 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`.
181
+
182
+ ## Existing component users
183
+
184
+ The repository also contains [low-level GitLab CI/CD components](templates) 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.
185
+
186
+ Mirror components into your GitLab instance and pin includes to an immutable revision. Consult the [component air-gap guide](docs/airgap.md) 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.
187
+
188
+ ## Development and validation
189
+
190
+ From a toolkit checkout with Python, Git, Node/npm, rsync, and Helm available:
191
+
192
+ ```sh
193
+ python -m pip install . build twine uv setuptools
194
+ npm ci --ignore-scripts --no-audit --no-fund
195
+ python scripts/sync_embedded.py --check
196
+ python scripts/sync_authoring_skill.py --check
197
+ python -m unittest discover -s tests -v
198
+ npm run test:ci-local
199
+ ```
200
+
201
+ 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](docs/testing-revision-one.md) for prerequisites, integration tests, release checks, and scenario selection.
202
+
203
+ Version 0.3.2 passed [fast CI](https://github.com/Heknon/generic-gitlab-cicd/actions/runs/33975049919) and [six real GitLab E2E scenarios](https://github.com/Heknon/generic-gitlab-cicd/actions/runs/33975818144). 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.
204
+
205
+ ## Documentation
206
+
207
+ - [CLI commands, file ownership, and path rules](docs/cli-reference.md)
208
+ - [Checks, builds, releases, and deployment workflows](docs/workflows-revision-one.md)
209
+ - [Organization configuration sources](docs/configuration-sources-revision-two.md)
210
+ - [AI-assisted authoring and portable skill](docs/ai-authoring-revision-three.md)
211
+ - [Publishing the toolkit to PyPI](docs/pypi-release.md)
212
+ - [Full documentation map](docs/README.md)
@@ -0,0 +1,201 @@
1
+ # Generic GitLab CI/CD
2
+
3
+ **Define your projects and checks. Generate a reviewable GitLab pipeline.**
4
+
5
+ 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.
6
+
7
+ 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.
8
+
9
+ [Quick start](#quick-start) · [Workflow guide](docs/workflows-revision-one.md) · [CLI reference](docs/cli-reference.md) · [Examples](examples/workflows) · [Documentation](docs/README.md)
10
+
11
+ ## Why use it?
12
+
13
+ Use this toolkit when several services or repositories share delivery conventions, but each team needs to choose its own checks and release behavior.
14
+
15
+ - **Keep application intent readable.** Name your checks and select them for pushes, merge requests, releases, manual pipelines, or schedules. The toolkit does not insert an assumed test suite.
16
+ - **Reuse platform configuration.** Share runner tags, prepared images, registries, and deployment targets through organization defaults and Git-backed templates.
17
+ - **Connect monorepo work explicitly.** Declare which projects are affected by upstream changes and which jobs need upstream artifacts. Artifact receipts verify the producing commit, pipeline, configuration, and file checksums.
18
+ - **Support internal infrastructure.** Use prepared runtime images, internal package services, and cached configuration sources. Consumer jobs have no automatic public toolkit bootstrap.
19
+ - **Review generated changes before execution.** Commit the generated YAML alongside its inputs; validate configuration and detect generation drift locally or in CI.
20
+
21
+ For a repository with a few standalone jobs, handwritten GitLab CI may be sufficient. This toolkit is most useful when repeated release, dependency, and deployment rules are becoming difficult to maintain consistently.
22
+
23
+ ## How it works
24
+
25
+ | File | What belongs here |
26
+ | --- | --- |
27
+ | `delivery.yml` | Projects, commands, workflow selection, builds, and deployments |
28
+ | `ci-platform.yml` | Runtime images, runner tags, registry locations, and deployment targets |
29
+ | `.gitlab-ci.yml` | Generated pipeline; regenerate after editing the inputs |
30
+ | `generic-ci.yml` + `generic-ci.lock.json` | Optional organization source configuration and its pinned commit |
31
+
32
+ Run `generic-ci validate`, inspect `generic-ci explain`, then run `generic-ci render`. Commit the inputs and generated pipeline together. GitLab executes a planner and the selected runtime jobs using your prepared images.
33
+
34
+ ## Quick start
35
+
36
+ Install the CLI as shown below, then run **`generic-ci setup`** from your application repository. It walks you through organization templates or standalone configuration, validates the result, and previews files before writing. It never overwrites existing files or installs a pre-commit hook.
37
+
38
+ ```sh
39
+ generic-ci setup
40
+ ```
41
+
42
+ Organization mode asks for a Git configuration repository (GitHub or GitLab), revision, template, and application settings. Standalone mode detects the ecosystem, asks for your existing test command and runtime infrastructure, and optionally creates a manual OpenShift MR preview with `deploy/values.yaml`. The chart must already be published and compatible with generic-app 2.x; setup does not provision infrastructure.
43
+
44
+ Both paths write the generated pipeline, setup notes, and local editor schemas. See [setup and editor integration](docs/setup-revision-one.md) for unattended flags, dry runs, schema mappings, and limitations.
45
+
46
+ The following manual walkthrough explains the files setup produces and remains useful when editing an existing configuration.
47
+
48
+ This example adds push and merge-request tests to an **existing Python project**. It assumes the repository already has a `pyproject.toml`, a committed `uv.lock`, and pytest declared in a dependency group. Replace the test command if your project uses something else.
49
+
50
+ ### 1. Install the CLI
51
+
52
+ Use Python **3.11 or newer**. From a checkout of this repository, install into an isolated environment:
53
+
54
+ ```sh
55
+ python -m venv .venv
56
+ . .venv/bin/activate
57
+ python -m pip install .
58
+ generic-ci --help
59
+ ```
60
+
61
+ For repeatable organization setup, distribute a versioned wheel through your approved internal package index or wheelhouse. Keep the authoring CLI and the toolkit installed in runner images on the **same version**. This source revision is **0.3.3**; source availability does not imply that version has been published to PyPI.
62
+
63
+ The install command uses your configured package sources. In an air-gapped environment, prepare the wheel and all dependencies internally first.
64
+
65
+ ### 2. Provide the runtime configuration
66
+
67
+ In your **application repository**, create `ci-platform.yml`:
68
+
69
+ ```yaml
70
+ version: 1
71
+ defaults:
72
+ tags: [internal-linux]
73
+ images:
74
+ python: registry.example.internal/ci/python-toolkit:0.3.3
75
+ container-builder:
76
+ engine: buildah
77
+ image: registry.example.internal/ci/buildah-toolkit:0.3.3
78
+ registries:
79
+ containers: registry.example.internal/apps
80
+ previews: registry.example.internal/previews
81
+ allowed-hosts:
82
+ - registry.example.internal
83
+ - gitlab.example.internal
84
+ variables:
85
+ UV_PYTHON_DOWNLOADS: never
86
+ ```
87
+
88
+ **Replace the example addresses and tags with your platform's values.** These images are placeholders, not publicly available toolkit images. The Python image needs Python, Git, uv, the matching toolkit, and your internal package/CA configuration. The builder image needs Buildah and the matching Python toolkit runtime. Builder and registry settings are required by the platform schema even though this test-only example does not build or push an image.
89
+
90
+ If your organization already provides a platform file or configuration source, use it. Platform maintainers can start with the [image-factory setup guide](starters/image-factory/CI-SETUP.md). Installing the CLI on your laptop does not prepare runner images.
91
+
92
+ ### 3. Define the checks
93
+
94
+ Create `delivery.yml` in the application repository:
95
+
96
+ ```yaml
97
+ version: 1
98
+ projects:
99
+ app:
100
+ path: .
101
+ python:
102
+ groups: all
103
+ checks:
104
+ unit:
105
+ script:
106
+ - uv run --no-sync pytest
107
+ workflows:
108
+ push:
109
+ checks: [unit]
110
+ merge-request:
111
+ checks: [unit]
112
+ ```
113
+
114
+ `path` is relative to the repository root. Commands run in that project directory. Python dependency preparation uses the committed lockfile; `--no-sync` prevents the test command from resynchronizing the environment. With `groups: all`, dependency groups must be mutually compatible.
115
+
116
+ This configuration selects `unit` for push and merge-request workflows. Push pipelines are suppressed when an open MR takes their place. It does not publish a package, build an image, or deploy an application.
117
+
118
+ ### 4. Validate, inspect, and generate
119
+
120
+ Run these commands from the application repository using the installed CLI:
121
+
122
+ ```sh
123
+ generic-ci validate
124
+ generic-ci explain -o ci-explain.json
125
+ generic-ci render -o .gitlab-ci.yml
126
+ generic-ci render --check -o .gitlab-ci.yml
127
+ ```
128
+
129
+ Review `ci-explain.json` and the generated jobs, then commit `delivery.yml`, `ci-platform.yml`, and `.gitlab-ci.yml`. The explanation file is optional diagnostic output.
130
+
131
+ Validate the generated YAML with **your GitLab CI Lint**, push the branch, and inspect the first pipeline. Local validation checks configuration and the job graph; it does not run pytest or check that a registry image exists. Your runner must match the configured tags and be able to pull the runtime image and reach the configured internal services.
132
+
133
+ After changing a command, platform setting, or source lock, render again. Use `generic-ci render --check -o .gitlab-ci.yml` in CI to detect stale generated YAML.
134
+
135
+ ## Add the delivery features you need
136
+
137
+ | Goal | Configuration / next step |
138
+ | --- | --- |
139
+ | Test Node, pnpm, or Bun projects | Declare `node.package-manager`, commit the corresponding lockfile, and use your existing commands; see the [workflow guide](docs/workflows-revision-one.md) |
140
+ | Build application artifacts | Set `build.script` and `build.outputs`; select `build: [application]` in the workflow |
141
+ | Retest downstream projects | Add project `depends-on: [sdk]`; this propagates change selection |
142
+ | Transfer generated files to another job | Add check/build `needs: [sdk.build]`; the producer must be enabled in the same event |
143
+ | Build and push containers | Configure `container` and select `build: [container]`; the default builder is Buildah |
144
+ | Publish Python or npm-compatible packages | Configure `package` and workflow `publish`; see [publication behavior](docs/workflows-revision-one.md#package-publication--revision-four) |
145
+ | Coordinate releases | Configure project versions, tag conventions, and optional `release.needs`; see the [release workflow](docs/workflows-revision-one.md#version-bumps-and-release-button) |
146
+ | Deploy to OpenShift | Configure a Helm deployment, target, values, and image bindings; start with the [deployment example](examples/workflows/delivery.yml) and [chart values](examples/helm-values.yaml) |
147
+
148
+ `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](docs/workflows-revision-one.md).
149
+
150
+ ## Share organization defaults
151
+
152
+ An organization source can provide platform defaults and starter templates. Initialize from a reviewed source revision:
153
+
154
+ ```sh
155
+ generic-ci init --repo ssh://git@gitlab.example.internal/platform/ci-config.git \
156
+ --ref v1.0.0 --template python-service
157
+ ```
158
+
159
+ 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.
160
+
161
+ 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](docs/configuration-sources-revision-two.md) for source layout, registration, updates, and offline setup.
162
+
163
+ ## OpenShift deployment
164
+
165
+ The bundled [generic-app chart](charts/generic-app) 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.
166
+
167
+ 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.
168
+
169
+ 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`.
170
+
171
+ ## Existing component users
172
+
173
+ The repository also contains [low-level GitLab CI/CD components](templates) 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.
174
+
175
+ Mirror components into your GitLab instance and pin includes to an immutable revision. Consult the [component air-gap guide](docs/airgap.md) 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.
176
+
177
+ ## Development and validation
178
+
179
+ From a toolkit checkout with Python, Git, Node/npm, rsync, and Helm available:
180
+
181
+ ```sh
182
+ python -m pip install . build twine uv setuptools
183
+ npm ci --ignore-scripts --no-audit --no-fund
184
+ python scripts/sync_embedded.py --check
185
+ python scripts/sync_authoring_skill.py --check
186
+ python -m unittest discover -s tests -v
187
+ npm run test:ci-local
188
+ ```
189
+
190
+ 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](docs/testing-revision-one.md) for prerequisites, integration tests, release checks, and scenario selection.
191
+
192
+ Version 0.3.2 passed [fast CI](https://github.com/Heknon/generic-gitlab-cicd/actions/runs/33975049919) and [six real GitLab E2E scenarios](https://github.com/Heknon/generic-gitlab-cicd/actions/runs/33975818144). 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.
193
+
194
+ ## Documentation
195
+
196
+ - [CLI commands, file ownership, and path rules](docs/cli-reference.md)
197
+ - [Checks, builds, releases, and deployment workflows](docs/workflows-revision-one.md)
198
+ - [Organization configuration sources](docs/configuration-sources-revision-two.md)
199
+ - [AI-assisted authoring and portable skill](docs/ai-authoring-revision-three.md)
200
+ - [Publishing the toolkit to PyPI](docs/pypi-release.md)
201
+ - [Full documentation map](docs/README.md)
@@ -1,3 +1,3 @@
1
1
  """Public configuration compiler. Runtime images must carry this exact version."""
2
2
 
3
- __version__ = "0.3.2"
3
+ __version__ = "0.3.3"
@@ -13,6 +13,13 @@ from .models import Pipeline, Platform
13
13
 
14
14
  def main(argv=None):
15
15
  argv = list(sys.argv[1:] if argv is None else argv)
16
+ if argv and argv[0] == 'setup':
17
+ from .setup import setup_main
18
+ try:
19
+ return setup_main(argv[1:])
20
+ except (ValueError, OSError, EOFError, ValidationError) as error:
21
+ print(f'generic-ci setup: {error}', file=sys.stderr)
22
+ return 1
16
23
  if argv and argv[0] == 'source':
17
24
  from .sources import source_main
18
25
  try:
@@ -21,7 +28,7 @@ def main(argv=None):
21
28
  print(f'generic-ci: {error}', file=sys.stderr)
22
29
  return 1
23
30
  parser = argparse.ArgumentParser(prog="generic-ci")
24
- parser.add_argument("command", choices=["schema", "validate", "explain", "render", "init"])
31
+ parser.add_argument("command", choices=["schema", "validate", "explain", "render", "init", "setup"])
25
32
  parser.add_argument("--config")
26
33
  parser.add_argument("--format", choices=["workflows", "legacy"], default="workflows")
27
34
  parser.add_argument("--ecosystem", choices=["python", "npm", "pnpm", "bun"], default="python")