Pipeline Runtime API
The runtime is the JavaScript/TypeScript execution environment for pipelines. It provides globals and functions for running containers, managing volumes, sending HTTP requests, and accessing pipeline context.
Global API
All pipelines have access to these globals:
runtime— container execution and volume managementhttp— webhook request/response handlingpipelineContext— metadata about the current executionassert— test assertions (useful for inline validation)
Example
typescript
const pipeline = async () => {
console.log("Starting pipeline:", pipelineContext.name);
const vol = await runtime.createVolume("data", 100);
const result = await runtime.run({
name: "build",
image: "golang:1.22",
command: { path: "go", args: ["build", "./..."] },
mounts: { "/workspace": vol },
});
console.log("Exit code:", result.code);
assert.equal(result.code, 0, "build must succeed");
};
export { pipeline };Browse detailed docs on the left.