Quick Start
This guide will help you get started with builderman by creating a simple pipeline with three tasks.
Basic Example
This example defines a simple CI pipeline where test runs only after build completes, and deploy runs only after test completes.
import { task, pipeline } from "builderman"
const build = task({
name: "build",
commands: {
build: "tsc",
dev: "tsc --watch",
},
})
const test = task({
name: "test",
commands: {
build: "npm test",
},
dependencies: [build],
})
const deploy = task({
name: "deploy",
commands: {
build: "npm run deploy",
},
dependencies: [test],
})
const result = await pipeline([build, test, deploy]).run({
command: "build",
})
console.log(result)
What This Does
- Creates three tasks:
build,test, anddeploy - Defines explicit dependencies between tasks
- Runs the pipeline in
buildmode - Returns a structured result with execution statistics
Result Structure
The result is always a structured object with an ok property:
if (result.ok) {
console.log("Pipeline succeeded!")
console.log("Duration:", result.stats.durationMs, "ms")
console.log("Tasks completed:", result.stats.summary.completed)
} else {
console.error("Pipeline failed:", result.error.message)
// Statistics are still available even on failure
console.log("Tasks that ran:", result.stats.summary.completed)
}
Next Steps: Learn about Core Concepts to understand tasks, commands, dependencies, and pipelines in detail.