Skip to main content

update

update deployments

♻️ Update a deployment's git source and build settings.

Repoint a deployment at another repository or branch, or change how it builds. Each flag is named after its manifest field, and only the flags you pass are sent: everything else keeps its saved value.

--git-url repository to build from --branch branch to build and to deploy on push --git-connection-id git connection that can clone the repository --root-directory the app's directory inside the repository --install-command dependency install command (static sites) --build-command build command --publish-directory directory the build outputs and publishes (static sites)

The deployment keeps serving its current build. The next push or csph deployment builds create <id> builds from the new source, and the new build replaces the live one only if it succeeds.

Pass the whole PATCH body instead with --file (JSON or YAML) or on stdin; it takes precedence over the flags. Run with only an id on a terminal, or with -i, to be prompted for the values.

This command supports reading input from a file. Files can be supplied via the --file flag or piped into the command.

Example of file structure
{}

Usage​

csph deployments update <deployment-id> [flags]

Aliases​

deployments update, deployments edit, deployment update, deployment edit, deploys update, deploys edit

Options​

Command Specific​

--account <string>
account ID
--branch <string>
branch to build and to deploy on push
--build-command <string>
build command, e.g. "npm run build"
--file <string>
specify a payload file [json|yaml], has precedence over other flags
--git-connection-id <string>
git connection that can clone the repository
--git-url <string>
git repository to build from, e.g. github.com/acme/site
--install-command <string>
dependency install command, e.g. "npm ci" (static sites)
--publish-directory <string>
directory the build outputs and that gets published, e.g. dist (static sites)
--root-directory <string>
directory of the app inside the repository (monorepos)

Formatting​

For more information about formatting options, see Formatting.

--fields <strings>
output JSON with the specified fields
--jq <string>
filter JSON output with jq expression

-o, --output <string>

output format: [table|plain|csv|json|yaml]
--template <string>
format JSON using a Go template

Available Fields​

env_id, environment, id, last_deployed_at, name, object, service_id, service_name, service_type, sphere_count, status, type

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

# point a static site at a different repository and branch
> csph deployment update <deployment-id> --git-url github.com/acme/site --branch main

# change how it builds
> csph deployment update <deployment-id> --install-command "npm ci" --build-command "npm run build" --publish-directory dist

# a monorepo app
> csph deployment update <deployment-id> --root-directory apps/web

# from a payload file, or from stdin
> csph deployment update <deployment-id> --file source.yaml
> echo '{"build_config":{"branch":"release"}}' | csph deployment update <deployment-id>

# be prompted for the values
> csph deployment update <deployment-id>
> csph deployment update

See also​