railway-deployment
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRailway Deployment Management
Railway部署管理
Manage existing Railway deployments: list, view logs, redeploy, or remove.
Important: "Remove deployment" () stops the current deployment but keeps the service. To delete a service entirely, use the railway-environment skill with .
railway downisDeleted: true管理现有的Railway部署:列出部署、查看日志、重新部署或移除部署。
重要说明: "移除部署"()会停止当前部署,但保留服务。若要完全删除服务,请使用带有参数的railway-environment技能。
railway downisDeleted: trueWhen to Use
使用场景
- User says "remove deploy", "take down service", "stop deployment", "railway down"
- User wants to "redeploy", "restart the service", "restart deployment"
- User asks to "list deployments", "show deployment history", "deployment status"
- User asks to "see logs", "show logs", "check errors", "debug issues"
- 用户提及"remove deploy"、"take down service"、"stop deployment"、"railway down"时
- 用户想要"重新部署"、"重启服务"、"重启部署"时
- 用户要求"列出部署"、"查看部署历史"、"部署状态"时
- 用户询问"查看日志"、"显示日志"、"检查错误"、"调试问题"时
List Deployments
列出部署
bash
railway deployment list --limit 10 --jsonShows deployment IDs, statuses, and metadata. Use to find specific deployment IDs for logs or debugging.
bash
railway deployment list --limit 10 --json显示部署ID、状态和元数据。用于查找特定部署ID以进行日志查看或调试。
Specify Service
指定服务
bash
railway deployment list --service backend --limit 10 --jsonbash
railway deployment list --service backend --limit 10 --jsonView Logs
查看日志
Deploy Logs
部署日志
bash
railway logs --lines 100 --jsonIn non-interactive mode, streaming is auto-disabled and CLI fetches logs then exits.
bash
railway logs --lines 100 --json在非交互模式下,流模式会自动禁用,CLI将获取日志后退出。
Build Logs
构建日志
bash
railway logs --build --lines 100 --jsonFor debugging build failures or viewing build output.
bash
railway logs --build --lines 100 --json用于调试构建失败或查看构建输出。
Logs for Failed/In-Progress Deployments
失败/进行中部署的日志
By default shows the last successful deployment. Use for current:
railway logs--latestbash
railway logs --latest --lines 100 --json默认情况下,显示最后一次成功的部署日志。使用参数查看当前部署的日志:
railway logs--latestbash
railway logs --latest --lines 100 --jsonFilter Logs
过滤日志
bash
undefinedbash
undefinedErrors only
仅显示错误
railway logs --lines 50 --filter "@level:error" --json
railway logs --lines 50 --filter "@level:error" --json
Text search
文本搜索
railway logs --lines 50 --filter "connection refused" --json
railway logs --lines 50 --filter "connection refused" --json
Combined
组合过滤
railway logs --lines 50 --filter "@level:error AND timeout" --json
undefinedrailway logs --lines 50 --filter "@level:error AND timeout" --json
undefinedTime-Based Filtering
基于时间的过滤
bash
undefinedbash
undefinedLogs from last hour
最近1小时的日志
railway logs --since 1h --lines 100 --json
railway logs --since 1h --lines 100 --json
Logs between 30 and 10 minutes ago
30分钟到10分钟前的日志
railway logs --since 30m --until 10m --lines 100 --json
railway logs --since 30m --until 10m --lines 100 --json
Logs from specific timestamp
特定时间戳的日志
railway logs --since 2024-01-15T10:00:00Z --lines 100 --json
Formats: relative (`30s`, `5m`, `2h`, `1d`, `1w`) or ISO 8601 timestamps.railway logs --since 2024-01-15T10:00:00Z --lines 100 --json
格式支持相对时间(`30s`、`5m`、`2h`、`1d`、`1w`)或ISO 8601时间戳。Logs from Specific Deployment
特定部署的日志
Deploy logs:
bash
railway logs <deployment-id> --lines 100 --jsonBuild logs:
bash
railway logs --build <deployment-id> --lines 100 --jsonGet deployment ID from .
railway deployment listNote: The deployment ID is a positional argument, NOT . The flag is a boolean that selects deploy logs (vs for build logs).
--deployment <id>--deployment--build部署日志:
bash
railway logs <deployment-id> --lines 100 --json构建日志:
bash
railway logs --build <deployment-id> --lines 100 --json部署ID可通过命令获取。
railway deployment list注意: 部署ID是位置参数,而非形式。是一个布尔标志,用于选择部署日志(与之相对的是标志用于选择构建日志)。
--deployment <id>--deployment--buildRedeploy
重新部署
Redeploy the most recent deployment:
bash
railway redeploy --service <name> -yThe flag skips confirmation. Useful when:
-y- Config changed via railway-environment skill
- Need to restart without new code
- Previous deploy succeeded but service misbehaving
重新部署最近的部署:
bash
railway redeploy --service <name> -y-y- 通过railway-environment技能修改了配置
- 需要在不更新代码的情况下重启服务
- 之前的部署成功,但服务运行异常
Restart Container Only
仅重启容器
Restart without rebuilding (picks up external resource changes):
bash
railway restart --service <name> -yUse when external resources (S3 files, config maps) changed but code didn't.
无需重新构建即可重启服务(会获取外部资源的变更):
bash
railway restart --service <name> -y适用于外部资源(如S3文件、配置映射)发生变更但代码未修改的场景。
Remove Deployment
移除部署
Takes down the current deployment. The service remains but has no running deployment.
bash
undefined停止当前部署。服务会保留,但没有运行中的部署。
bash
undefinedRemove deployment for linked service
移除关联服务的部署
railway down -y
railway down -y
Remove deployment for specific service
移除特定服务的部署
railway down --service web -y
railway down --service api -y
This is what users mean when they say "remove deploy", "take down", or "stop the deployment".
**Note:** This does NOT delete the service. To delete a service entirely, use the railway-environment skill with `isDeleted: true`.railway down --service web -y
railway down --service api -y
这对应用户所说的"remove deploy"、"take down"或"stop the deployment"操作。
**注意:** 此操作不会删除服务。若要完全删除服务,请使用带有`isDeleted: true`参数的railway-environment技能。CLI Options
CLI选项
deployment list
deployment list
| Flag | Description |
|---|---|
| Service name or ID |
| Environment name or ID |
| Max deployments (default 20, max 1000) |
| JSON output |
| 标志 | 描述 |
|---|---|
| 服务名称或ID |
| 环境名称或ID |
| 最大部署数量(默认20,最大1000) |
| 以JSON格式输出 |
logs
logs
| Flag | Description |
|---|---|
| Service name or ID |
| Environment name or ID |
| Show deploy logs (default, boolean flag) |
| Show build logs (boolean flag) |
| Number of lines (required) |
| Filter using query syntax |
| Start time (relative or ISO 8601) |
| End time (relative or ISO 8601) |
| Most recent deployment (even if failed) |
| JSON output |
| Specific deployment (optional) |
| 标志 | 描述 |
|---|---|
| 服务名称或ID |
| 环境名称或ID |
| 显示部署日志(默认选项,布尔标志) |
| 显示构建日志(布尔标志) |
| 日志行数(必填) |
| 使用查询语法过滤日志 |
| 起始时间(相对时间或ISO 8601格式) |
| 结束时间(相对时间或ISO 8601格式) |
| 显示最近的部署日志(即使部署失败) |
| 以JSON格式输出 |
| 特定部署的ID(可选) |
redeploy
redeploy
| Flag | Description |
|---|---|
| Service name or ID |
| Skip confirmation |
| 标志 | 描述 |
|---|---|
| 服务名称或ID |
| 跳过确认步骤 |
restart
restart
| Flag | Description |
|---|---|
| Service name or ID |
| Skip confirmation |
| 标志 | 描述 |
|---|---|
| 服务名称或ID |
| 跳过确认步骤 |
down
down
| Flag | Description |
|---|---|
| Service name or ID |
| Environment name or ID |
| Skip confirmation |
| 标志 | 描述 |
|---|---|
| 服务名称或ID |
| 环境名称或ID |
| 跳过确认步骤 |
Presenting Logs
日志展示建议
When showing logs:
- Include timestamps
- Highlight errors and warnings
- For build failures: show error and suggest fixes
- For runtime crashes: show stack trace context
- Summarize patterns (e.g., "15 timeout errors in last 100 logs")
展示日志时:
- 包含时间戳
- 高亮显示错误和警告信息
- 对于构建失败:显示错误信息并给出修复建议
- 对于运行时崩溃:显示堆栈跟踪上下文
- 总结日志中的模式(例如:"最近100条日志中出现15次超时错误")
Composability
组合使用
- Push new code: Use railway-deploy skill
- Check service status: Use railway-status skill
- Fix config issues: Use railway-environment skill
- Create new service: Use railway-new skill
- 推送新代码:使用railway-deploy技能
- 检查服务状态:使用railway-status技能
- 修复配置问题:使用railway-environment技能
- 创建新服务:使用railway-new技能
Error Handling
错误处理
No Service Linked
未关联服务
No service linked. Run `railway service` to select one.No service linked. Run `railway service` to select one.No Deployments Found
未找到部署
No deployments found. Deploy first with `railway up`.No deployments found. Deploy first with `railway up`.No Logs Found
未找到日志
Deployment may be too old (log retention limits) or service hasn't produced output.
部署可能过于陈旧(受日志保留限制),或者服务尚未生成任何输出。