mcloud-deployments

作者: medusajs

執行 mcloud deployments 指令以列出部署、取得部署詳細資訊,以及擷取建置日誌。用於列出部署、檢查部署…

npx skills add https://github.com/medusajs/medusa-agent-skills --skill mcloud-deployments

Cloud CLI: Deployments Commands

Execute mcloud deployments commands to inspect deployments and their build logs.

Constraints

  • Always pass --json when parsing output — plaintext format may change.
  • Always confirm context (mcloud whoami --json) before running commands if org/project are not already known.
  • Use --deployment IDs in the format depl_* or build IDs; build IDs resolve to their latest deployment automatically.

Commands

deployments list

List recent deployments for a project (default: 20 most recent across all environments).

mcloud deployments list --organization <org-id> --project <project-id-or-handle> --json

Options:

  • -o/--organization <id> — Organization ID (falls back to active context)
  • -p/--project <id-or-handle> — Project ID or handle (falls back to active context)
  • -e/--environment <handle> — Filter by environment handle
  • --environment-type <production|long-lived|preview> — Filter by environment type
  • --commit <sha> — Filter by Git commit SHA (full or prefix)
  • --limit <1-200> — Max results (default: 20)
  • --offset <number> — Pagination offset (default: 0)
  • --json — Output as JSON

deployments get

Retrieve a single deployment's details by ID.

mcloud deployments get <deployment-id> --organization <org-id> --project <project-id-or-handle> --json

Arguments:

  • deployment — Deployment ID (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>, --json

deployments build-logs

Fetch build logs for a deployment. Use this to debug build-failed status.

mcloud deployments build-logs <deployment-id> --organization <org-id> --project <project-id-or-handle>

Arguments:

  • deployment — Deployment ID (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>
  • --type <backend|storefront> — Which build log stream to read (default: backend)
  • --json — Output as JSON

Deployment Statuses

StatusMeaning
createdBuild not started yet
buildingBuild running
builtBuild succeeded, awaiting rollout
deployingRolling out to environment
deployedLive and serving traffic
build-failedBuild step failed — read build-logs
deployment-failedBuild succeeded, runtime crashed — read mcloud logs
timed-outExceeded time budget (backend only)
canceledSuperseded by a newer deployment
idleNo longer the active deployment

Examples

# List all deployments (with active context set)
mcloud deployments list --json

# Find most recent build-failed deployment
mcloud deployments list --json \
  | jq -r '[.[] | select(.backend_status == "build-failed")][0].id'

# Get deployment details
mcloud deployments get bld_01ABC123 --json

# Read backend build logs
mcloud deployments build-logs bld_01ABC123

# Read storefront build logs
mcloud deployments build-logs bld_01ABC123 --type storefront

# Filter deployments by commit SHA
mcloud deployments list --commit a1b2c3d --json | jq '.'

# Get deployments for a specific environment
mcloud deployments list --environment production --json

來自 medusajs 的更多技能

creating-agents-in-medusa
medusajs
在 Medusa 專案中建置內部管理導向的 AI 代理時使用。這些代理由商家和商店營運者操作,而非顧客。涵蓋…
mcloud-local
medusajs
執行 mcloud local build 以在本機重現 Cloud build。用於偵錯建置失敗的部署時,無需推送到追蹤分支,…
reviewing-prs
medusajs
審查 Medusa 儲存庫的 GitHub pull requests。檢查 PR 範本合規性、貢獻指南、程式碼慣例、安全性、效能,以及…
writing-releases
medusajs
為Medusa版本撰寫符合既有風格的GitHub發布說明。當需要從提交和PR清單生成發布說明草稿時使用…
writing-tsdocs
medusajs
在 Medusa 程式碼庫中為 TypeScript 原始檔新增和更新 TypeDoc (TSDoc) 註解。涵蓋 HTTP 類型、API 路由、UI 元件、資料模型、服務…
mcloud-variables
medusajs
執行 mcloud variables 指令,列出並取得雲端環境的環境變數。用於檢查、讀取或匯出環境…
writing-docs
medusajs
撰寫並更新Medusa文件中的MDX檔案,涵蓋book、resources、ui、user-guide和cloud專案。當需要根據…進行文件變更時使用。
building-storefronts
medusajs
以SDK為優先的前端整合方式,適用於Medusa商店前端,採用React Query模式並遵循關鍵API呼叫規則。所有API請求必須使用Medusa JS SDK,絕不能使用一般的fetch(),因為它缺少必要的標頭(商店路由需要可發布的API金鑰,管理路由需要驗證資訊)。傳遞純JavaScript物件給SDK方法,切勿對主體參數使用JSON.stringify(),因為SDK會自動處理序列化。使用useQuery處理GET請求,使用useMutation處理POST/DELETE請求...