guara-deploy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deploying on GuaraCloud

在GuaraCloud上部署

Build Methods

构建方式

MethodWhen to useWhat happens
dockerfile
Project has a DockerfileBuilds using the Dockerfile in the repo
buildpack
No Dockerfile, or prefer auto-detectionHeroku-style buildpacks detect language and build automatically
For monorepos, use
--root-dir
,
--build-cmd
, and
--start-cmd
to specify the subdirectory and custom commands.
方式适用场景执行逻辑
dockerfile
项目包含Dockerfile使用仓库中的Dockerfile进行构建
buildpack
无Dockerfile,或偏好自动检测采用Heroku风格的buildpack自动检测语言并完成构建
对于Monorepo,可使用
--root-dir
--build-cmd
--start-cmd
指定子目录与自定义命令。

Create a Project

创建项目

bash
guara projects create --name my-app
bash
guara projects create --name my-app

Create a Service

创建服务

bash
undefined
bash
undefined

With Dockerfile

With Dockerfile

guara services create --name api --build-method dockerfile --repo https://github.com/user/repo --port 3000
guara services create --name api --build-method dockerfile --repo https://github.com/user/repo --port 3000

With buildpack

With buildpack

guara services create --name api --build-method buildpack --repo https://github.com/user/repo --port 8080
guara services create --name api --build-method buildpack --repo https://github.com/user/repo --port 8080

Monorepo (buildpack)

Monorepo (buildpack)

guara services create --name web --build-method buildpack
--repo https://github.com/user/monorepo
--root-dir ./apps/web
--build-cmd "pnpm --filter web build"
--start-cmd "pnpm --filter web start"
--port 3000
guara services create --name web --build-method buildpack
--repo https://github.com/user/monorepo
--root-dir ./apps/web
--build-cmd "pnpm --filter web build"
--start-cmd "pnpm --filter web start"
--port 3000

Interactive (no flags)

Interactive (no flags)

guara services create

Creating a service does NOT trigger a build. Deploy separately after creation.

**Requires:** GitHub App installed. If not installed, the CLI will prompt with a link.
guara services create

创建服务不会触发构建。请在创建完成后单独执行部署操作。

**要求:** 已安装GitHub App。若未安装,CLI会提示安装链接。

Deploy

部署

bash
guara deploy                    # Deploy default branch
guara deploy --branch develop   # Deploy specific branch
guara deploy --commit abc123f   # Deploy specific commit
The CLI polls deployment status and shows a spinner. Terminal statuses:
  • healthy — deployment succeeded, service is live
  • failed — build or deploy error occurred
  • rolled_back — deployment was replaced by a rollback
  • superseded — a newer deployment replaced this one
bash
guara deploy                    # Deploy default branch
guara deploy --branch develop   # Deploy specific branch
guara deploy --commit abc123f   # Deploy specific commit
CLI会轮询部署状态并显示加载动画。终端状态说明:
  • healthy — 部署成功,服务已上线
  • failed — 构建或部署过程中出现错误
  • rolled_back — 该部署已被回滚操作替代
  • superseded — 该部署已被新版本部署替代

Rollback

回滚

bash
guara rollback                     # Interactive: pick from healthy deployments
guara rollback --deployment <id>   # Direct rollback to specific deployment
Only deployments with status
healthy
and a valid image are available for rollback.
bash
guara rollback                     # Interactive: pick from healthy deployments
guara rollback --deployment <id>   # Direct rollback to specific deployment
仅状态为
healthy
且镜像有效的部署可用于回滚。

Service Lifecycle

服务生命周期

bash
guara services stop      # Scale to zero replicas
guara services start     # Restore to configured replicas
guara services restart   # Rolling restart (zero downtime)
guara services delete    # Permanent deletion
bash
guara services stop      # Scale to zero replicas
guara services start     # Restore to configured replicas
guara services restart   # Rolling restart (zero downtime)
guara services delete    # Permanent deletion

Autoscaling

Autoscaling

bash
guara scale --autoscaling on    # Enable autoscaling
guara scale --autoscaling off   # Disable, use fixed replicas
bash
guara scale --autoscaling on    # Enable autoscaling
guara scale --autoscaling off   # Disable, use fixed replicas

Custom Domains

自定义域名

bash
undefined
bash
undefined

Add domain

Add domain

guara domains add --domain api.myapp.com
guara domains add --domain api.myapp.com

The CLI returns a CNAME target. User must add this DNS record:

The CLI returns a CNAME target. User must add this DNS record:

api.myapp.com CNAME <cname-target>

api.myapp.com CNAME <cname-target>

Verify status

Verify status

guara domains list
guara domains list

Remove

Remove

guara domains remove --domain api.myapp.com

Domain status progresses: `pending` → `active` once DNS propagates and verification succeeds.
guara domains remove --domain api.myapp.com

域名状态会经历:`pending`(待验证)→ `active`(已激活),该过程在DNS解析完成且验证通过后完成。

Environment Variables

环境变量

bash
guara env set DATABASE_URL=postgres://...
guara env set KEY1=val1 KEY2=val2
guara env list
guara env unset KEY
Important: Setting or unsetting env vars triggers a rolling restart of the service.
To make a variable available during Docker builds (as a build arg):
bash
guara env set NPM_TOKEN=xxx --build
bash
guara env set DATABASE_URL=postgres://...
guara env set KEY1=val1 KEY2=val2
guara env list
guara env unset KEY
重要提示: 设置或删除环境变量会触发服务的滚动重启。
若要让变量在Docker构建阶段可用(作为构建参数):
bash
guara env set NPM_TOKEN=xxx --build

Deployment Status Check

部署状态检查

After deploying, verify the service is healthy:
bash
guara services info
Check deployment history:
bash
guara deployments list
For step-by-step deployment scenarios, see references/workflows.md.
For tier limits and pricing, see guaracloud.com/docs.
部署完成后,可通过以下命令验证服务是否健康:
bash
guara services info
查看部署历史:
bash
guara deployments list
如需分步部署场景示例,请查看references/workflows.md
关于层级限制与定价信息,请访问guaracloud.com/docs