build
The build commands.
How an application becomes an image: the method that builds it, the directory the build runs in, the command that starts it, and which file changes are worth a build at all.
Changing any of this rebuilds nothing on its own. The running application keeps the
image it already has until the next build, which --deploy starts. That is a longer
wait than an environment variable change, which needs only a deployment rather than
a build.
build get
Show how an application is built.
Usage
outplane build get [flags]Flags
| Flag | Type | Description |
|---|---|---|
--app | string | Application name or id. Defaults to the linked app. A flag rather than an argument, to match the rest of this group. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
app | string | |
appId | string | |
source | string | Where the image comes from, which decides what can be set at all. One of repository, container-registry. |
buildMethod | string | Prebuilt-image means nothing is built here. One of dockerfile, buildpack, prebuilt-image. |
directory | string | null | Where the build runs, / being the repository root. |
startCommand | string | null | Overrides the image's own command. |
includePaths | string | null | Glob patterns, one per line. A push touching none of them does not build. |
ignorePaths | string | null | Glob patterns, one per line. A push touching only these does not build. |
image | string | null | The reference a registry application runs. |
changed | bool | Always false here; build set reports the change. |
deploymentId | int | null | Always null here. |
Examples
Show the linked application's build settings
outplane build getShow another application's
outplane build get --app checkoutRead one setting in a script
outplane build get --json --fields buildMethod,directory{
"buildMethod": "dockerfile",
"directory": "/api"
}What to Know
- source decides which fields mean anything. A container-registry application has an image and a start command; its buildMethod is prebuilt-image and its directory and filters are null and cannot be set.
- Both filters are one string with a pattern per line, which is how the platform stores them.
build settakes them as a repeatable flag instead. - An empty filter means every push builds. It is null rather than an empty string.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of context.no_app, app.not_found. Branch on that, or on the exit status. The message is prose and changes.
build set
Change how an application is built.
Usage
outplane build set [flags]Flags
| Flag | Type | Description |
|---|---|---|
--app | string | Application name or id. Defaults to the linked app. A flag rather than an argument, to match the rest of this group. |
--method | string | How the repository becomes an image. One of dockerfile, buildpack. |
--dir | string | The directory the build runs in. / is the repository root, and it cannot be emptied. |
--start-command | string | Overrides the image's own command. An empty value removes it. |
--include-paths | strings | Build only when a push touches one of these globs, repeatable. An empty value removes the filter. Repeatable. |
--ignore-paths | strings | Skip the build when a push touches only these globs, repeatable. An empty value removes the filter. Repeatable. |
--image | string | The image to run. Only for an application that runs a prebuilt one. |
--deploy | bool | Build and deploy afterwards, so the change takes effect now. |
The global flags apply as well.
Output
| Field | Type | Description |
|---|---|---|
app | string | |
appId | string | |
source | string | One of repository, container-registry. |
buildMethod | string | The value after the change, not the part that changed. One of dockerfile, buildpack, prebuilt-image. |
directory | string | null | |
startCommand | string | null | |
includePaths | string | null | |
ignorePaths | string | null | |
image | string | null | |
changed | bool | False for a dry run. |
deploymentId | int | null | The deployment --deploy started, or null when it was not given. |
Examples
Build with buildpacks instead of a Dockerfile
outplane build set --method buildpackBuild only when the API directory changes
outplane build set --include-paths 'api/**' --include-paths package.jsonRemove the start command
outplane build set --start-command ""See what would be written, without writing it
outplane build set --dir /api --dry-run --json{
"buildMethod": "dockerfile",
"changed": false,
"directory": "/api",
"source": "repository",
"startCommand": "node server.js"
}Move a registry application to a new image tag, and deploy it
outplane build set --image ghcr.io/acme/api:1.4.2 --app checkout --deployWhat to Know
- A flag that is not given keeps its current value. The endpoint writes every field it is given, so this command reads the current settings and sends them back with the change applied; two callers changing different settings at the same time can therefore lose one of the changes.
- An empty value clears, for the start command and both filters. --dir cannot be emptied and returns build.directory_required; --dir / is how to build from the repository root.
- A container-registry application refuses --method, --dir and the filters with build.not_built_here, and a repository application refuses --image with build.not_an_image. Neither is sent, because the server would ignore them in silence.
- The filters are a repeatable flag here and one newline-separated string in the result, which is how the platform stores them.
- Nothing rebuilds on its own. Without --deploy the running application keeps the image it was built from, which is a longer wait than an environment variable: the change takes effect only after a build, not after a restart.
- Calling this twice with the same flags leaves the same state, so a retry after a timeout is safe.
Errors
Beyond 0 for success, this command exits with:
| Exit | Kind | Meaning |
|---|---|---|
2 | usage | Invalid arguments, unknown flag, or client-side validation failure. |
3 | auth | Not authenticated, token revoked or expired, or forbidden for this team. |
5 | not_found | The named resource does not exist, or is not visible to this credential. |
8 | upstream | The Out Plane API returned a server error. |
The code on the error object is one of build.method_invalid, build.directory_required, build.image_required, build.filter_too_long, build.not_built_here, build.not_an_image, usage.no_change, context.no_app, app.not_found. Branch on that, or on the exit status. The message is prose and changes.