Skip to main content

csph deployments 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) --skip-redeploy save the change without starting a build

Leave out --git-connection-id when the deployment has no git connection yet (for example an image deploy moving to a git build): csph picks the one connection that can clone --git-url, and says which. When none or several can, it stops and names them. csph git connections list --repos shows them all.

A change to the source or build settings starts a build from them at once. The service keeps serving its current build until the new one is live, and the new build replaces it only if it succeeds. Pass --skip-redeploy to only save the change: the next push or csph deployment builds create <id> then builds.

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)
--skip-redeploy
save the change without starting a build; the next push or deploy builds from it

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​

access, env_id, environment, hooks, id, instance_type, instance_type_detail, last_deployed_at, name, object, service_id, service_name, service_type, sphere_count, status, status_reason, 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

# move an image deploy to a git build (the connection is picked for you)
> csph deployment update <deployment-id> --git-url github.com/acme/api --branch main

# save a new branch now, build it later
> csph deployment update <deployment-id> --branch release --skip-redeploy

# 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​