Skip to main content

deploy

deploy an app in one shot

🚀 Deploy an app in one shot.

deploy is the ship verb: it is a thin skin over apply, so it uses the exact same engine — it posts a computesphere.yaml manifest to the server, then waits for the new service to reach Running and prints its URL (like fly deploy).

It resolves what to deploy from one of three sources, in this order:

  1. --image <ref> — a prebuilt image. deploy synthesizes a one-service manifest (a web-service on --port, default 8080) and applies it. The service name is derived from the image (ghcr.io/me/api:v1 → api); override it with --name. Use --write to also save the synthesized computesphere.yaml to the current directory.
  2. --file <path> — apply an explicit manifest.
  3. otherwise — a computesphere.yaml (or .yml) in the current directory.

If none of these resolve, deploy errors instead of guessing.

A private image needs registry credentials: pass --registry-username, --registry-password, and --registry-url together (all three are required; --image-provider defaults to docker). The synthesized manifest then carries image_type: private plus the credentials — for that deploy only. Credentials are never echoed, and --write refuses to save them to disk: feed the password from an environment variable or CI secret instead of typing it inline.

Building from local source (--build .) or a git URL is not available yet.

NOTE (breaking change): deploy is now the ship verb. It used to be an alias for the deployments management group — that alias has been removed. Use csph deployments (or deployment / deploys) for deployment management.

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 deploy [flags]

Options​

Command Specific​

--atomic
roll every resource back if any fails (all-or-nothing)
--environment <string>
environment ID
--file <string>
specify a payload file [json|yaml], has precedence over other flags
--force
overwrite an existing ./computesphere.yaml when used with --write
--image <string>
deploy a prebuilt image as a one-service web app
--image-provider <string>
registry provider for a private --image (default "docker")
--name <string>
name
--no-wait
return as soon as resources are created; don't wait for the deployment to be running

--port <int> (default 8080)

container port for the --image service (a new service defaults to 8080; an existing one keeps its port unless this is set)
--project <string>
project ID
--registry-password <string>
password or token for the private registry hosting --image (prefer a CI secret: --registry-password "$REGISTRY_PASSWORD")
--registry-url <string>
URL of the private registry hosting --image (e.g. https://ghcr.io)
--registry-username <string>
username for the private registry hosting --image

--wait-timeout <duration> (default "5m0s")

how long to wait for the deployment to reach Running
--write
with --image, also write the synthesized manifest to ./computesphere.yaml

Formatting​

For more information about formatting options, see Formatting.

-o, --output <string>

output format: [table|plain|csv|json|yaml]

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​

# deploy the computesphere.yaml in the current directory
> csph deploy

# deploy a prebuilt image as a one-service web app
> csph deploy --image ghcr.io/me/api:v1

# ...on a custom port, with an explicit service name
> csph deploy --image ghcr.io/me/api:v1 --name my-api --port 3000

# synthesize and save computesphere.yaml, then deploy
> csph deploy --image ghcr.io/me/api:v1 --write

# deploy a private image (password from an env var / CI secret — never inline)
> csph deploy --image registry.example.com/me/api:v1 \
--registry-url https://registry.example.com \
--registry-username ci-bot \
--registry-password "$REGISTRY_PASSWORD"

# deploy an explicit manifest
> csph deploy --file ./computesphere.yaml

# a computesphere.yaml that builds from source instead of a prebuilt image
> cat computesphere.yaml
version: "2"
services:
- name: api
type: web-service
build_source: git
runtime_type: docker
git_url: https://github.com/acme/api
branch: main
dockerfile: ./Dockerfile
build_args:
NODE_ENV: production
env_vars:
LOG_LEVEL: info
port: 8000
> csph deploy

See also​