Build System
Purpose: For contributors, provides Mise tasks, CI/CD pipelines, and artifact publishing details.
Overview
The openCenter ecosystem uses three distinct build systems, one per language:
| Repository | Language | Build Tool | Task Runner | Artifacts |
|---|---|---|---|---|
| openCenter-cli | Go 1.25.2 | go build | mise | Binary (bin/opencenter) |
| openCenter-AirGap | Python 3.10+ | setuptools | pytest / pip | Zarf packages (.tar.zst) |
| headlamp-branding-plugin | TypeScript | webpack | pnpm | Plugin bundles (dist/) |
openCenter-cli (Go + mise)
mise (.mise.toml) defines all build, test, and release tasks. Key tasks:
| Task | Command | Description |
|---|---|---|
build | mise run build | Compiles binary with version ldflags to bin/opencenter |
build-linux | mise run build-linux | Cross-compiles for linux/amd64 |
build-all | mise run build-all | Builds for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 |
test | mise run test | Runs go test ./internal/... |
godog | mise run godog | Runs BDD tests via godog (skips @wip scenarios) |
test-properties | mise run test-properties | Runs property-based tests (TestProperty*) |
fmt | mise run fmt | Runs gofmt -w . |
schema | mise run schema | Generates JSON schema to schema/cluster.schema.json |
release | mise run release <version> | Builds all platforms + generates release notes |
mise also manages tool versions. The [tools] section in .mise.toml pins golang, kubectl, kind, and helm to latest.
Version information is injected at build time via Go ldflags:
go build -ldflags "-X main.version=${VERSION} -X main.gitCommit=${GIT_COMMIT} ..."
openCenter-AirGap (Python + setuptools)
Build configuration lives in pyproject.toml. The package uses setuptools with src/ layout.
| Command | Description |
|---|---|
pip install -e ".[dev]" | Install in editable mode with dev dependencies |
pytest | Run test suite (strict markers, 300s timeout) |
pytest --cov=src | Run with coverage (minimum 80%) |
black src/ tests/ | Format code (line length 100) |
mypy src/ | Type check (strict mode) |
pylint src/opencenter_build/ | Lint |
The CLI entry point is opencenter-airgap, registered via [project.scripts] in pyproject.toml.
headlamp-branding-plugin (TypeScript + pnpm)
The monorepo uses pnpm workspaces. pnpm-workspace.yaml includes plugins/*.
| Command | Description |
|---|---|
pnpm install | Install all workspace dependencies |
pnpm run build | Build all plugins (webpack production) |
pnpm run dev | Start dev servers for all plugins |
pnpm test | Run Jest tests across all plugins |
pnpm run lint | ESLint across all plugins |
pnpm run format | Prettier across all plugins |
Target a specific plugin with --filter:
pnpm --filter @opencenter/headlamp-plugin-branding run build
CI/CD pipelines
All repositories use GitHub Actions. Common patterns:
- PRs trigger lint, test, and build checks
- Tags trigger release workflows
- The CLI release task (
mise run release <version>) generates platform binaries and release notes, then publishes viagh release create - AirGap builds produce Zarf packages (
.tar.zst) as release artifacts - Headlamp plugins are packaged as ZIP files attached to GitHub releases
Knowledgebase (Jekyll)
The knowledgebase site uses Jekyll 3.8 with Bundler:
bundle install
bundle exec jekyll serve
See Website Development Setup for details.