> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy history

> Build, deploy and roll back application code on a selected installation.

Publish reviewed source to a specific installation. A production deploy uses
an explicit target or a deploy key scoped to production. Use
`--expected-source-commit` on a managed deploy to require the reviewed
commit.

## Build once, deploy anywhere

Build the program once and keep the reference it prints.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection build --installation "$SOURCE"
bijection deploy --installation "$TARGET" --program "$PROGRAM"
bijection list sys.programs --by at --descending --first 20
```

`bijection build` captures and builds the source on a hosted installation
without deploying it, and prints the built program, `program:<64 hex>`. That
is the same id `bijection list sys.programs` lists for a deployed program.
`bijection deploy --program <program>` deploys that program on any installation
of the project without capturing source again. A rollback deploys the program of an
earlier deploy; a promotion deploys a program built for another installation,
which is rebuilt for the target first and deploys only if it is the same
program. `bijection list sys.programs` is the deploy history. Deploying
application code does not undo committed transactions or the work of tasks
already performed.

## Deploy what you reviewed

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deploy --installation "$TARGET" --program "$PROGRAM" --seen "$VERSION"
```

`--seen <version>` names the installation version you reviewed, a `v1.…`
token as `bijection version` prints it. The deploy refuses `Conflict` when
the installed program moved past that version, for example because someone
else deployed or rolled back since. Review the installation again and deploy
with its current version.

A managed deploy reports backend activation and app publication separately.
Keep the request reference and use `bijection status request watch` for progress
or `bijection status request resume` to continue an interrupted request. See
[Portable archives](https://docs.bijection.com/operate/installations/portable-archives.md) to transfer a
completed build between installations.

## Cancel a publication

For a hosted publication, use the installation and deploy ID from
`bijection deploy list <installation>`. For a directly addressed backend,
use the original publication request reference.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection deploy cancel <installation> <deploy-id>
bijection deploy cancel <request>
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.