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.
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: branchd/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 takes the k8s, cf-worker, renderer, electron
and upl-im (or upl-pipelines) app types, and helm: charts. A k8s app
deploys with deploy.method: flux; another method is refused with a
message, so move the app to Flux first. Apps of type cli, npm,
library, proto and mobile are refused by the service preset: each is
a preset of its own (branchd/presets/cli@v1, and so on).
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: apiAfter:
# .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: branchd/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.shThen 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.