[bldr]docs

Deploy it

Declare a deployment, run it, and see what it did.

A deployment is a step you declare in build code and invoke on demand. It is the last piece of the story: the same graph that built and ran the thing also puts it somewhere.

Declare one

members/site/.bldr.ts
scope.addDeployment("staging", "deployment/local.shell/v0.0.0", {
    commands: ["echo 'deploying the site'"],
});

A deployment names a function and the options it takes. deployment/local.shell/v0.0.0 runs shell commands on the node. There are others, including a composite that runs other deployments in sequence, in parallel, or as try/catch/finally.

Run it

Attached to a build, so it deploys what that build produced:

bldr build --deploy site/staging --name "deploy to staging"

Or on its own:

bldr deploy <CID>
bldr deployments            # past runs

Either way you get the same progress tree, and the run is recorded.

What you have now

Starting from an empty directory, you have a workspace with members, a target that builds into content, an export that puts files on disk, a service that runs from the same definition, and a deployment that acts on it. Each of those is one line in build code and one flag on bldr build.

The pieces compose because they all point at the same artifact:

bldr build --export site/site:./out --run site/web --deploy site/staging --name "everything"

One build, three actions, all against the same output. Each waits on its own target, so a slow one never holds up a fast one.

Where to go next

On this page