Skip to main content

csph launch

deploy a repository for the first time, asking only for what it needs

🚀 Deploy a repository for the first time.

launch takes you from a repository to a running service in one command. It reads the repository through your Git connection, says what it builds as (a Dockerfile, a language runtime, or a static site) and which port it uses, then asks only for the settings the app can't start without:

  • a secret is typed with the input hidden, and is never printed;
  • a setting that can be generated (an app's secret key) is generated for you on the server;
  • a database, cache or queue the app uses can be created and connected.

Settings the app reads but doesn't need to start are listed, not asked. It then deploys with the same engine as apply, and waits for the service to be running.

Give it a folder in a checkout (default: the current folder) or a repository URL. In a checkout, the branch checked out and the folder you're in are what deploy; --branch and --root change them.

With no terminal, or with --no-input, nothing is asked: settings come from --env-file, and --generate and --create-data-services say yes to those offers. Settings in --env-file the app doesn't appear to read are skipped and listed; --include-extra-env adds them as secrets. If a required setting still has no value, nothing is deployed and launch exits 16, naming every missing setting.

Exit codes: 0 running, 1 the deploy failed, 16 refused before deploying.

Usage​

csph launch [path | repository-url] [flags]

Options​

Command Specific​

--branch <string>
branch, tag or commit to deploy (default: the checked-out branch, or the repository's default)
--create-data-services
create and connect every database, cache or queue the app uses, without asking
--data-service-type <csph database|cache|queue instance-types>
size of a database, cache or queue it creates, by id (see csph database|cache|queue instance-types); default: the free one when the account can still have it
--dockerfile <string>
build from this Dockerfile (path from the repository root) instead of what was detected
--env-file <string>
file of NAME=value settings to deploy with (values are never printed)
--environment <string>
environment ID
--generate
generate every setting that can be generated, without asking
--include-extra-env
also add the --env-file settings the app doesn't appear to read, as secrets, without asking (default: asked on a terminal, skipped without one)
--language <string>
build with this language's runtime instead of what was detected (one the platform builds; an unknown one lists them)
--name <string>
service name (default: the repository's or the folder's name)
--no-wait
return once the deploy starts; don't wait for it to be running
--project <string>
project ID
--root <string>
folder inside the repository to deploy (default: the current folder in a checkout, else the root)

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

how long to wait for the deploy to be running

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 repository you're in, answering what it asks
> csph launch

# a repository by URL, a folder inside it, a service name
> csph launch https://github.com/acme/shop --root services/api --name shop-api

# in CI: settings from a file, generate what can be, create the database
> csph launch --no-input --env-file deploy.env --generate --create-data-services

See also​