Coming from .xeonr-ci.yaml
Move a repository from .xeonr-ci.yaml to a pipeline file that uses the service preset, with its own jobs beside it.
Available in repositories branchd reads pipeline files for. It is switching repositories on one at a time: until yours is, it keeps running its
.forge-ci.yamlor.xeonr-ci.yaml. See What is available.
Not yet available (xeonr/forge/presets): the service preset,
xeonr/forge/presets/service@v1, has a release (tagsv1.0.0andv1.0.1), but its repository is still private, visible only to its own team, until its visibility is set to organisation: until then, the file below is refused. Moving a repository's own jobs to pipeline files works today.
A .xeonr-ci.yaml is the service preset's configuration on its own. In a
pipeline file the same keys go, unchanged, under preset.with, and jobs of
your own sit beside the preset's under jobs:.
Mapping
.xeonr-ci.yaml | Pipeline file |
|---|---|
The file's keys (apps, lint, commits, migrations, buf, lantern, docs, …) | The same keys under preset: {uses: xeonr/forge/presets/service@v1, with: …} |
Extra jobs in .gitlab-ci.yml beside it | jobs: in the same file, with needs: [preset.<address>] |
| A job of yours that a preset job must wait for | needs: on the preset entry (apps.<name>.needs, test.needs, lint.needs, migrations.needs) naming your job |
XEONR_CI_CHANGES in .gitlab-ci.yml | changes: true under with |
| Overriding a preset job by its name | Not possible: change with:, or ask for a setting in the preset |
build:api, deploy:api:prod job names | Addresses: preset.apps.api.build, preset.gitops.prod |
docs: enabled: true | The same; docs.pipeline names the docs repository's pipeline (default build) |
The service preset ports the k8s app type first. Other app types (cli,
npm, cf-worker, renderer, electron, upl-im) and helm: are refused, each
with a message, until they are ported.
A worked conversion
Before:
# .xeonr-ci.yaml
# Before: the service preset's configuration on its own.
lint:
golangci: true
commits:
lint: true
apps:
api:
type: k8s
test:
image: golang:1.26
command: go vet ./... && go test -race -count=1 ./...
build:
image: api
After:
# .branchd/pipelines/ci.yaml
# After: the same keys under preset.with, unchanged. A job of your own sits
# beside the preset's and waits for one of them by its address.
name: CI
preset:
uses: xeonr/forge/presets/service@v1
with:
lint:
golangci: true
commits:
lint: true
apps:
api:
type: k8s
test:
image: golang:1.26
command: go vet ./... && go test -race -count=1 ./...
build:
image: api
jobs:
e2e:
needs: [preset.apps.api.build]
image: ${{ needs.preset.apps.api.build.outputs.image }}
steps:
- run: /app/e2e.sh
Then delete .xeonr-ci.yaml: a repository with both is refused. Check the
result with branchd ci plan: the preset's jobs are listed by address
beside yours.