Skip to content
Dashboard

Deploy commands

Copy page
View as Markdown

These commands deploy a project and show what it is doing.

Build a folder and deploy it as a project.

Terminal window
grayspar deploy [flags] [folder]
Argument Description
folder Deploy only the files under this folder of the project (default: “.”).
Flag Description
-y, --yes Take the plan as shown without asking.
--name <name> Create a new project with this name.
--no-env Deploy without reading any .env file.
--env-file <path> Read variables from a specific file.
--env-conflict <winner> Which value wins where your .env differs from a saved one (choices: “saved”, “file”).
-s, --service <name> Deploy only this service, repeatable.
--path <name=path> Where a new service answers, repeatable.
--no-path <name> A new service that takes no requests, like a background worker.
--dockerfile <name=path> The Dockerfile a new service builds from.
--volume <name=path> A folder a service keeps across deploys, repeatable.

The first deploy creates the project and links the folder to it. Later deploys in that folder update the same project.

Terminal window
grayspar deploy
grayspar deploy --yes --name <project-name>
grayspar deploy --service web
grayspar deploy --path web=/ --path api=/api --no-path worker
grayspar deploy --volume app=/app/data

Show each service’s address and status.

Terminal window
grayspar status [flags]
Terminal window
<project-name>
SERVICE URL STATUS
app https://<project-name>.grayspar.com Running

Show a service’s logs, or with –build its last build log.

Terminal window
grayspar logs [flags]
Flag Description
-s, --service <name> Which service to read.
--build Show the log from the last build instead.
-f Keep printing new lines as they arrive.
Terminal window
grayspar logs --service api -f
grayspar logs --build

Start a fresh copy of a service’s running version.

Terminal window
grayspar restart [flags]
Flag Description
-s, --service <name> Which service to restart.
Terminal window
grayspar restart --service api

Link this folder to a project.

Terminal window
grayspar link [flags]

Run this command in a folder that has no link, such as a second copy of the code. The link is saved in .grayspar/project.json.

Unlink this folder from its project.

Terminal window
grayspar unlink [flags]

The next grayspar deploy in that folder can create a new project. The project itself keeps running.