Purpose: For developers, explains the mise-based build system and how tasks are organized.
Why Mise?
openCenter-cli uses Mise instead of Make for several reasons:
-
Tool version management - Automatically installs correct Go, kubectl, kind, helm versions
-
Cross-platform - Works on macOS, Linux, and WSL2 without modification
-
Task automation - Replaces Make with more readable task definitions
-
Environment management - Handles environment variables and PATH configuration
-
Developer experience - Single command to set up entire development environment
Configuration File
All build configuration is in .mise.toml:
[tools]
golang = "1.26.3"
kubectl = "latest"
kind = "latest"
helm = "latest"
[env]
KIND_EXPERIMENTAL_PROVIDER = "podman"
CONTAINER_RUNTIME = "podman"
[tasks]
# Task definitions
build = '''#!/usr/bin/env bash
...
'''
Tool Management
Installed Tools
Mise manages these tools:
-
Go 1.26.3 - Primary language
-
kubectl - Kubernetes CLI
-
kind - Local Kubernetes clusters
-
helm - Kubernetes package manager
Task System
Task Categories
Tasks are organized by function:
Build tasks:
-
build- Build binary with version info -
build-linux- Build for Linux -
build-all- Build for all platforms -
release- Build release binaries -
publish- Generate release notes
Test tasks:
-
test- Run unit tests -
godog- Run BDD tests -
godog-wip- Run WIP scenarios -
test-properties- Run property tests -
test-security- Run security tests -
test-integration- Run integration tests
Code quality tasks:
-
fmt- Format code with gofmt -
tidy- Tidy Go modules -
upgrade-deps- Upgrade dependencies
Schema tasks:
-
schema- Generate JSON schema -
schema-gen- Generate from Go structs -
schema-verify- Comprehensive verification
Validation tasks:
-
validate- Validate configuration -
preflight- Run preflight checks
Documentation tasks:
-
docs-gen- Generate CLI documentation
Cleanup tasks:
-
clean- Remove build artifacts
Task Anatomy
Build Process
Version Information
Build injects version info via ldflags:
GIT_COMMIT=$(git rev-parse HEAD)
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
GIT_TAG=$(git describe --tags --exact-match 2>/dev/null || echo "")
BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
VERSION=${GIT_TAG:-"0.0.1"}
go build -ldflags "\
-X main.version=${VERSION} \
-X main.gitCommit=${GIT_COMMIT} \
-X main.gitBranch=${GIT_BRANCH} \
-X main.gitTag=${GIT_TAG} \
-X main.buildDate=${BUILD_DATE}" \
-o bin/opencenter
Accessed in code:
var (
version string
gitCommit string
gitBranch string
gitTag string
buildDate string
)
func init() {
if version == "" {
version = "dev"
}
}
Cross-Platform Builds
Build for multiple platforms:
# Linux AMD64
GOOS=linux GOARCH=amd64 go build -o bin/opencenter-linux-amd64
# Linux ARM64
GOOS=linux GOARCH=arm64 go build -o bin/opencenter-linux-arm64
# macOS Intel
GOOS=darwin GOARCH=amd64 go build -o bin/opencenter-darwin-amd64
# macOS Apple Silicon
GOOS=darwin GOARCH=arm64 go build -o bin/opencenter-darwin-arm64
Run with: mise run build-all
Environment Variables
Task Dependencies
Tasks can depend on other tasks:
[tasks]
# Build before testing
test-with-build = [
"mise run build",
"mise run test"
]
# Full verification
verify = [
"mise run build",
"mise run fmt",
"mise run test",
"mise run godog",
"mise run schema-verify"
]
Custom Tasks
Creating New Tasks
Add to .mise.toml:
[tasks]
my-task = '''
#!/usr/bin/env bash
set -e
echo "Running my custom task..."
# Your commands here
'''
Common Workflows
Task Execution
Best Practices
Troubleshooting
Evidence
This documentation is based on the following repository files:
-
Mise configuration:
.mise.toml:1-961(complete file) -
Tool versions:
.mise.toml:1-5(tools section) -
Environment variables:
.mise.toml:7-20(env section) -
Task definitions:
.mise.toml:23-961(tasks section) -
Build process:
.mise.toml:23-47(build task) -
Version injection:
.kiro/steering/tech.md:143-149 -
Development guide:
.kiro/steering/tech.md:1-149 -
Product overview:
.kiro/steering/product.md:23-28