-
Notifications
You must be signed in to change notification settings - Fork 0
Designing Phases and Scopes
Beez does not prescribe a schema. This page suggests practical ways to name and structure phase+scope pairs.
For a small project, one scope is enough:
step({ name = "configure", phase = "build", scope = "default", ... })
step({ name = "compile", phase = "build", scope = "default", ... })
step({ name = "test", phase = "test", scope = "default", ... })
workflow("all", {
{ phase = "build", scope = "default" },
{ phase = "test", scope = "default" },
})Add scopes when you need to run subsets independently.
Use a new phase for a distinct pipeline stage you might invoke alone:
| Phase (examples) | Typical steps |
|---|---|
configure |
CMake, Conan install |
build |
Compile, link |
test |
Unit, integration tests |
qa |
Lint, format-check |
package |
Archive, install |
clean |
Remove artifacts |
Phases map well to workflow order:
workflow("ci", {
{ phase = "build", scope = "default" },
{ phase = "test", scope = "default" },
{ phase = "qa", scope = "default" },
})Use a new scope for a variant of the same phase that should not mix steps with other variants:
| Situation | Example scopes under build
|
|---|---|
| Release vs debug |
release, debug
|
| Host vs cross-compile |
native, arm
|
| Fast vs full checks |
smoke, full
|
Each variant often has its own configure step in the same or a configure phase:
step({ name = "configure:debug", phase = "configure", scope = "debug", ... })
step({ name = "build:debug", phase = "build", scope = "debug", ... })
step({ name = "configure:release", phase = "configure", scope = "release", ... })
step({ name = "build:release", phase = "build", scope = "release", ... })beez -p build:debug
beez -p build:releasePick one style and stay consistent:
| Style | Step name | Phase | Scope |
|---|---|---|---|
| Colon in step name | build:compile |
build |
default |
| Plain step name | compile |
build |
default |
| Phase in step name | configure:setup |
configure |
code |
order() always uses step name:
order("configure:setup", "build:compile")Phase and scope strings in workflows do not need to match step name prefixes.
Each scope owns a full configure/build/test chain. Workflows pick one scope:
workflow("sanitize", {
{ phase = "configure", scope = "sanitize" },
{ phase = "build", scope = "sanitize" },
{ phase = "test", scope = "sanitize" },
})Generate docs and code at the same time:
workflow("ci", {
{ parallel = {
{ phase = "generate", scope = "docs" },
{ phase = "generate", scope = "code" },
}},
{ phase = "compile", scope = "code" },
})Keep lint/format under qa so beez -p qa:default runs checks without building:
workflow("quality", {
{ phase = "qa", scope = "default" },
})-- Misleading: scope does not limit files
step({ name = "lint", phase = "qa", scope = "src/lib", mutate = { "src/**" }, ... })Use input/mutate for files. Use scope for selection (for example default vs strict).
Putting configure, build, test, and deploy all under phase = "all" with only order() works but removes the benefit of -p and readable workflows. Prefer separate phases unless the pipeline is tiny.
step({ name = "compile", phase = "build", scope = "debug", ... })
step({ name = "compile", phase = "build", scope = "release", ... }) -- replaces firstThe second registration wins globally. Use unique names: compile:debug, compile:release.
Comma-separated scopes run sequentially. Use workflow parallel for concurrent phase+scope pairs.
- Can I run this subset with
beez -p phase:newscope? - Do steps in this scope need separate
configurefrom other scopes? - Are step names unique across the whole
build.lua? - Does a workflow (or documented
-pcommand) expose this scope to users?
- First Pipeline - minimal example
- How Phases and Scopes Work - execution details
- Selecting with Phases and Scopes - workflow and CLI syntax
Quick Reference · Glossary · FAQ
- Fundamentals
- Core Concepts
- Project Layout
- First Pipeline
- Phases and Scopes
- How Phases and Scopes Work
- Selecting with Phases and Scopes
- Designing Phases and Scopes
- Parallel Execution and Dependencies
- Configuration
- Configuration Overview
- Global User Config
- Project Config
- Environment Variables
- Performance Settings
- Cache Settings
- Config Reference
- CLI
- CLI Overview
- Running Targets
- Filtering by Phase
- Running a Single Step
- Listing Entities
- Output and Logging Flags
- Cache and Maintenance Flags
- Meta and Utility Commands
-
Project Scaffolding —
beez --init(embedded Tempify) - CLI Flag Reference
- Lua DSL
- DSL Overview
- Plugin System — Plugins, Config DSL, Standard-Workflows
- Step Declaration
- Task Declaration
- Workflow Declaration
- Order Declaration
- Configure Step
- ReqPack Declaration
- Beez API
- Step Context
- DSL Patterns
- Caching
- Caching Overview
- Step Cache
- Success Cache
- Glob Metadata Cache
- Artifact Patterns
- Cache Keys and Invalidation
- Cache Storage and Maintenance
- Caching Troubleshooting
- UI and Output
- Output Modes
- Progress and Animation
- Colors and Themes
- Run Summaries
- Logging and Log Files
- Development and Contribution
- Building and Setup
- Repository Layout
- Testing
- Code Quality
- Feature Development Workflow
- Submitting Changes