dx-devops-pipeline-manage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDevOps Center Pipeline Management
DevOps Center 流水线管理
Manages the complete pipeline lifecycle in DevOps Center — from creation against a repository, through stage and environment configuration and project attachment, to activation of a ready-to-promote release pipeline. Provides headless CLI-driven operations for autonomous release workflows.
管理DevOps Center中流水线的完整生命周期——从关联仓库创建流水线,到阶段与环境配置、项目附加,再到激活可用于晋升的发布流水线。提供基于无头CLI的操作,支持自主发布工作流。
Scope
适用范围
- In scope: List pipelines, get pipeline details, create a pipeline (linked to an existing or new Git repo), add/delete/rename stages, add/delete Salesforce environments on stages, attach/detach projects, and activate/deactivate/rename the pipeline
- Out of scope: Work-item lifecycle, promotion/deployment execution, conflict detection, standalone project creation (separate skills)
- 包含的操作:列出流水线、获取流水线详情、创建流水线(关联现有或新Git仓库)、添加/删除/重命名阶段、在阶段中添加/删除Salesforce环境、附加/分离项目、激活/停用/重命名流水线
- 不包含的操作:工作项生命周期、晋升/部署执行、冲突检测、独立项目创建(对应单独的技能)
Required Inputs
必要输入
Gather or infer before proceeding:
- Operation type: list, get, create, add-stage, delete-stage, rename-stage, add-environment, delete-environment, attach-project, detach-project, activate, or deactivate
- For get / any stage or environment op: pipeline ID (required) — obtain via
sf devops pipeline list --json - For create: pipeline name (required) and a Git repo (, required). Repo flags differ by scenario:
--repo- Existing repo (GitHub or Bitbucket): only — do not pass
--repo <url>/--repo-type--create-repo - New GitHub repo:
--repo <name> --create-repo --repo-type github --repo-owner <org-or-user> - New Bitbucket repo: (
--repo <name> --create-repo --repo-type bitbucket --bitbucket-workspace <workspace>optional)--bitbucket-project-key <key> - Description () optional in all cases
--description
- Existing repo (GitHub or Bitbucket): only
- For add-stage: pipeline ID, new stage name, and (the stage the new one precedes) — get stage IDs via
--next-stage-idsf devops pipeline get - For add-environment: pipeline ID, stage ID, environment name, and (Production or Sandbox)
--org-type - For attach/detach-project: pipeline ID and project ID
- For activate/deactivate/rename: pipeline ID
Defaults unless specified:
- Output format: for headless consumption
--json - Target org: use if not relying on the default org
--target-org <alias>
If the user gives a clear request ("create a pipeline on repo myorg/myrepo", "add a UAT stage before Production", "activate pipeline 0XB..."), proceed immediately without unnecessary questions.
执行前需收集或推断以下信息:
- 操作类型:list、get、create、add-stage、delete-stage、rename-stage、add-environment、delete-environment、attach-project、detach-project、activate或deactivate
- 针对get/任何阶段或环境操作:流水线ID(必填)——可通过获取
sf devops pipeline list --json - 针对create:流水线名称(必填)和Git仓库(,必填)。仓库参数因场景而异:
--repo- 现有仓库(GitHub或Bitbucket):仅需——请勿传递
--repo <url>/--repo-type--create-repo - 新GitHub仓库:
--repo <name> --create-repo --repo-type github --repo-owner <org-or-user> - 新Bitbucket仓库:(
--repo <name> --create-repo --repo-type bitbucket --bitbucket-workspace <workspace>可选)--bitbucket-project-key <key> - 所有场景中描述()均为可选
--description
- 现有仓库(GitHub或Bitbucket):仅需
- 针对add-stage:流水线ID、新阶段名称和(新阶段将排在该阶段之前)——可通过
--next-stage-id获取阶段IDsf devops pipeline get - 针对add-environment:流水线ID、阶段ID、环境名称和(Production或Sandbox)
--org-type - 针对attach/detach-project:流水线ID和项目ID
- 针对activate/deactivate/rename:流水线ID
默认设置(除非另行指定):
- 输出格式:,用于无头场景消费
--json - 目标组织:若不依赖默认组织,使用
--target-org <alias>
如果用户给出明确请求(如"在仓库myorg/myrepo上创建流水线"、"在Production之前添加UAT阶段"、"激活流水线0XB..."),请直接执行,无需额外询问。
Workflow
工作流
All operations use and CLI commands with output for structured consumption. Pipeline IDs and stage IDs are the primary identifiers — resolve them via and before mutating.
sf devops pipelinesf devops stage--jsonlistget所有操作均使用和 CLI命令,并以格式输出,便于结构化消费。流水线ID和阶段ID是主要标识符——在修改前需通过和命令获取。
sf devops pipelinesf devops stage--jsonlistgetPhase 1 — Identify Operation
阶段1 — 确定操作类型
- Determine the operation type from user intent:
- "list", "show all pipelines" → list; "details of pipeline", "show stages" → get
- "create", "set up", "new pipeline" → create
- "add stage", "insert stage" → add-stage; "rename stage" → rename-stage; "remove/delete stage" → delete-stage
- "connect environment", "add org to stage" → add-environment; "remove environment" → delete-environment
- "attach project", "connect project" → attach-project; "detach project" → detach-project
- "activate", "turn on"; "deactivate", "turn off"; "rename pipeline" → lifecycle update
- 根据用户意图确定操作类型:
- "列出"、"显示所有流水线" → list;"流水线详情"、"显示阶段" → get
- "创建"、"设置"、"新流水线" → create
- "添加阶段"、"插入阶段" → add-stage;"重命名阶段" → rename-stage;"移除/删除阶段" → delete-stage
- "连接环境"、"为阶段添加组织" → add-environment;"移除环境" → delete-environment
- "附加项目"、"连接项目" → attach-project;"分离项目" → detach-project
- "激活"、"开启";"停用"、"关闭";"重命名流水线" → 生命周期更新
Phase 2 — Execute Operation
阶段2 — 执行操作
-
Verify org authentication before any operation:bash
sf org display --json- If no default org is set or auth has expired, instruct the user to run
sf org login web --set-default --alias <alias> - Confirm the org has DevOps Center enabled by running
sf devops pipeline list --json - Add to every command when targeting a specific org
--target-org <alias>
- If no default org is set or auth has expired, instruct the user to run
-
Inspect pipelines:bash
sf devops pipeline list --json # all pipelines in the org sf devops pipeline get --pipeline-id <pipeline-id> --json # one pipeline, with stages/repos/projects- returns SObject records under
listwith capitalized fields (.result.pipelines[],.Id,.Name) — it does not include stages or connected projects.IsActive - returns a single pipeline under
getwith camelCase fields (.result,.id,.name,.stages[]); each stage has.connectedProjects[],.id,.name,.nextStageId, and.branchName. Stages are a linked list — order is defined by.environment.{id,name}, and the terminal stage hasnextStageId. UsenextStageId: nullto discover stage IDs before any stage or environment operationget
-
Create a pipeline — the pipeline must be linked to a Git repository.and
--nameare always required; the remaining flags depend on the repo scenario:--repobash# Existing repo (GitHub or Bitbucket) — pass the full repo URL, nothing else sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> --json # New GitHub repo — requires --repo-owner sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \ --create-repo --repo-type github --repo-owner <org-or-user> --json # New Bitbucket repo — requires --bitbucket-workspace (--bitbucket-project-key optional) sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \ --create-repo --repo-type bitbucket --bitbucket-workspace <workspace> \ --bitbucket-project-key <key> --json # Custom stage chain (any scenario) — repeat --stage in promotion order sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> \ --stage Dev --stage QA --stage Prod --json- Provider-specific required flags: GitHub new repo → ; Bitbucket new repo →
--repo-owner. Omitting the provider's required flag fails the create--bitbucket-workspace - Do not pass /
--repo-typefor an existing repo — supply only the repo URL via--create-repo--repo - Custom stages at create time: a new pipeline seeds the default stage chain Integration → UAT → Staging → Production. To seed different stages, repeat once per stage in promotion order — e.g.
-s/--stage. This avoids adding/renaming stages afterward--stage Dev --stage QA --stage Prod - Add optionally in any scenario
--description "<text>" - Capture the returned pipeline ID for subsequent stage/environment/project/activation steps
- Idempotency: the CLI does not dedupe. Before creating, run and check for a pipeline with the same name/repo; return the existing one if found. See
sf devops pipeline list --jsonfor the check-before-create snippetreferences/parsing-patterns.md
- Provider-specific required flags: GitHub new repo →
-
Configure stages — a stage is added relative to an existing stage, then bound to an environment. Readfor full flag details before multi-stage work:
references/cli-commands.mdbash# Insert an empty stage BEFORE an existing stage (get the next-stage-id from `pipeline get`) sf devops pipeline stage add --pipeline-id <id> --name "<stage-name>" --next-stage-id <stage-id> --json # Rename a stage sf devops pipeline stage update --pipeline-id <id> --stage-id <stage-id> --name "<new-name>" --json # Delete a stage (predecessor auto-relinks to successor) sf devops pipeline stage delete --pipeline-id <id> --stage-id <stage-id> --json- inserts an empty stage (no branch/environment) before
stage add; configure its environment separately--next-stage-id - Build the promotion chain by inserting each new stage before the stage that should follow it
-
Bind environments to stages — attach a Salesforce org to a stage:bash
# Validate the org-type against the fixed enum BEFORE calling the CLI bash scripts/validate-org-type.sh "<Production|Sandbox>" # exits non-zero on an invalid value sf devops stage environment add --pipeline-id <id> --stage-id <stage-id> \ --environment-name "<env-name>" --org-type <Production|Sandbox> --json # Remove an environment (pipeline must be inactive) sf devops stage environment delete --pipeline-id <id> --environment-id <env-id> --json- must be exactly
--org-typeorProduction— runSandboxfirst and only proceed on exit 0scripts/validate-org-type.sh <value> - Headless caveat: triggers an OAuth browser flow. In headless/CI runs pass
stage environment add— the CLI prints a redirect URL for manual authentication--no-browser
-
Attach / detach a project — a project can be attached to only one pipeline:bash
sf devops pipeline project add --pipeline-id <id> --project-id <project-id> --json sf devops pipeline project delete --pipeline-id <id> --project-id <project-id> --json- If the user names a project instead of providing its ID, resolve it via (see
sf devops project list --json)references/parsing-patterns.md
- If the user names a project instead of providing its ID, resolve it via
-
Activate / deactivate / rename the pipeline:bash
# Before activating, confirm the deterministic ≥1-stage prerequisite bash scripts/check-activation-ready.sh <id> [target-org] # exits non-zero if stage-less sf devops pipeline update --pipeline-id <id> --activate --json # activate sf devops pipeline update --pipeline-id <id> --deactivate --json # deactivate sf devops pipeline update --pipeline-id <id> --name "<new-name>" --json # rename- Before , run
--activateand only proceed on exit 0 — it fails with an actionable message when the pipeline has no stagesscripts/check-activation-ready.sh <id> - Stages cannot be modified after the pipeline is activated and changes are promoted through it — finish stage/environment configuration before activating
- and
--activateare mutually exclusive;--deactivateand--deactivatemay be combined in one command--name
- Before
-
执行任何操作前验证组织身份认证:bash
sf org display --json- 若未设置默认组织或认证已过期,指导用户运行
sf org login web --set-default --alias <alias> - 通过运行确认该组织已启用DevOps Center
sf devops pipeline list --json - 当目标为特定组织时,在所有命令中添加
--target-org <alias>
- 若未设置默认组织或认证已过期,指导用户运行
-
查看流水线信息:bash
sf devops pipeline list --json # 组织中的所有流水线 sf devops pipeline get --pipeline-id <pipeline-id> --json # 单个流水线,包含阶段/仓库/项目信息- 返回
list下的SObject记录,字段为大写(.result.pipelines[]、.Id、.Name)——不包含阶段或关联项目.IsActive - 返回
get下的单个流水线,字段为小驼峰格式(.result、.id、.name、.stages[]);每个阶段包含.connectedProjects[]、.id、.name、.nextStageId和.branchName。阶段为链表结构——顺序由.environment.{id,name}定义,终端阶段的nextStageId为null。在执行任何阶段或环境操作前,使用nextStageId命令获取阶段IDget
-
创建流水线——流水线必须关联Git仓库。和
--name始终为必填项;其余参数取决于仓库场景:--repobash# 现有仓库(GitHub或Bitbucket)——传递完整仓库URL即可 sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> --json # 新GitHub仓库——需要--repo-owner sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \ --create-repo --repo-type github --repo-owner <org-or-user> --json # 新Bitbucket仓库——需要--bitbucket-workspace(--bitbucket-project-key可选) sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \ --create-repo --repo-type bitbucket --bitbucket-workspace <workspace> \ --bitbucket-project-key <key> --json # 自定义阶段链(任何场景)——按晋升顺序重复--stage参数 sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> \ --stage Dev --stage QA --stage Prod --json- 特定提供商必填参数:新GitHub仓库 → ;新Bitbucket仓库 →
--repo-owner。遗漏提供商必填参数会导致创建失败--bitbucket-workspace - 针对现有仓库,请勿传递/
--repo-type——仅通过--create-repo提供仓库URL即可--repo - 创建时自定义阶段:新流水线默认生成阶段链为「Integration → UAT → Staging → Production」。如需生成不同阶段,按晋升顺序为每个阶段重复参数——例如
-s/--stage。这样可避免后续添加/重命名阶段--stage Dev --stage QA --stage Prod - 所有场景中可选择性添加
--description "<text>" - 记录返回的流水线ID,用于后续的阶段/环境/项目/激活操作
- 幂等性:CLI不会自动去重。创建前运行,检查是否存在同名/同仓库的流水线;若存在则返回现有流水线。幂等性检查代码片段可参考
sf devops pipeline list --jsonreferences/parsing-patterns.md
- 特定提供商必填参数:新GitHub仓库 →
-
配置阶段——阶段需相对于现有阶段添加,然后绑定到环境。**执行多阶段操作前,请阅读**获取完整参数详情:
references/cli-commands.mdbash# 在现有阶段之前插入一个空阶段(从`pipeline get`获取next-stage-id) sf devops pipeline stage add --pipeline-id <id> --name "<stage-name>" --next-stage-id <stage-id> --json # 重命名阶段 sf devops pipeline stage update --pipeline-id <id> --stage-id <stage-id> --name "<new-name>" --json # 删除阶段(前驱阶段会自动链接到后继阶段) sf devops pipeline stage delete --pipeline-id <id> --stage-id <stage-id> --json- 会在
stage add指定的阶段之前插入一个空阶段(无分支/环境);需单独配置其环境--next-stage-id - 通过在后续阶段之前插入每个新阶段来构建晋升链
-
将环境绑定到阶段——将Salesforce组织附加到阶段:bash
# 在调用CLI前,验证org-type是否符合固定枚举值 bash scripts/validate-org-type.sh "<Production|Sandbox>" # 若值无效则返回非零退出码 sf devops stage environment add --pipeline-id <id> --stage-id <stage-id> \ --environment-name "<env-name>" --org-type <Production|Sandbox> --json # 移除环境(流水线必须处于停用状态) sf devops stage environment delete --pipeline-id <id> --environment-id <env-id> --json- 必须严格为
--org-type或Production——先运行Sandbox,仅当退出码为0时才继续执行scripts/validate-org-type.sh <value> - 无头场景注意事项:会触发OAuth浏览器流程。在无头/CI运行中传递
stage environment add——CLI会打印重定向URL供手动认证--no-browser
-
附加/分离项目——一个项目只能附加到一条流水线:bash
sf devops pipeline project add --pipeline-id <id> --project-id <project-id> --json sf devops pipeline project delete --pipeline-id <id> --project-id <project-id> --json- 如果用户提供项目名称而非项目ID,可通过解析获取(参考
sf devops project list --json)references/parsing-patterns.md
- 如果用户提供项目名称而非项目ID,可通过
-
激活/停用/重命名流水线:bash
# 激活前,确认流水线至少包含一个阶段的前置条件 bash scripts/check-activation-ready.sh <id> [target-org] # 若无阶段则返回非零退出码 sf devops pipeline update --pipeline-id <id> --activate --json # 激活 sf devops pipeline update --pipeline-id <id> --deactivate --json # 停用 sf devops pipeline update --pipeline-id <id> --name "<new-name>" --json # 重命名- 执行前,运行
--activate,仅当退出码为0时才继续执行——当流水线无阶段时,该脚本会返回可操作的错误信息scripts/check-activation-ready.sh <id> - 流水线激活且已完成晋升后,无法修改阶段——请在激活前完成阶段/环境配置
- 和
--activate互斥;--deactivate和--deactivate可在同一命令中组合使用--name
- 执行
Phase 3 — Verify and Report
阶段3 — 验证并报告结果
-
Verify operation success — use, which performs the deterministic JSON-status and post-state field checks and exits non-zero with an actionable message on mismatch:
scripts/verify-operation.shbash# Assert a captured command's JSON status is 0 (pipe the CLI output in) sf devops pipeline update --pipeline-id <id> --activate --json | bash scripts/verify-operation.sh status - # Assert post-state after activate / stage / project ops bash scripts/verify-operation.sh active <id> true [target-org] # isActive == true bash scripts/verify-operation.sh has-stage <id> "<stage>" [target-org] # stage present in chain bash scripts/verify-operation.sh has-project <id> "<project>" [target-org] # project connected- Create: confirm the pipeline appears in by
sf devops pipeline list --jsonand capture its.Name.Id - Stage / environment / project changes: verify with the /
has-stagemodes above (they readhas-projectand checksf devops pipeline get/.result.stages[]).result.connectedProjects[] - Activate: verify with the mode
active <id> true
- Create: confirm the pipeline appears in
-
Report results:
- List: pipeline name, ID, and active state per pipeline (no stages — that's what is for)
get - Get: pipeline name, ID, active state, stage chain (each stage's name → environment → branch, ordered via ), connected projects
nextStageId - Create: pipeline ID, name, and linked repo (or "existing pipeline returned" on idempotent match)
- Stage / environment / project op: the resulting stage chain with each stage's environment, in promotion order
- Lifecycle: the new active state and/or name
- List: pipeline name, ID, and active state per pipeline (no stages — that's what
-
验证操作成功——使用,该脚本会检查JSON状态和操作后的状态字段,若不匹配则返回非零退出码并给出可操作信息:
scripts/verify-operation.shbash# 断言捕获的命令JSON状态为0(将CLI输出传入) sf devops pipeline update --pipeline-id <id> --activate --json | bash scripts/verify-operation.sh status - # 断言激活/阶段/项目操作后的状态 bash scripts/verify-operation.sh active <id> true [target-org] # isActive == true bash scripts/verify-operation.sh has-stage <id> "<stage>" [target-org] # 阶段存在于链中 bash scripts/verify-operation.sh has-project <id> "<project>" [target-org] # 项目已连接- 创建操作:确认流水线通过出现在
.Name中,并记录其sf devops pipeline list --json.Id - 阶段/环境/项目变更:通过上述/
has-stage模式验证(它们会读取has-project的结果,检查sf devops pipeline get/.result.stages[]).result.connectedProjects[] - 激活操作:通过模式验证
active <id> true
- 创建操作:确认流水线通过
-
报告结果:
- List操作:每条流水线的名称、ID和激活状态(不包含阶段——阶段信息需通过获取)
get - Get操作:流水线名称、ID、激活状态、阶段链(每个阶段的名称→环境→分支,按排序)、关联项目
nextStageId - Create操作:流水线ID、名称和关联仓库(若为幂等匹配则返回"返回现有流水线")
- 阶段/环境/项目操作:更新后的阶段链,包含每个阶段的环境,按晋升顺序排列
- 生命周期操作:新的激活状态和/或流水线名称
- List操作:每条流水线的名称、ID和激活状态(不包含阶段——阶段信息需通过
Verification Checklist (gate before reporting success)
验证清单(报告成功前需确认)
Confirm the items for the operation you performed. Do not report success until every applicable box holds:
- Every command was run with
sf devopsand returned--json(status: 0)scripts/verify-operation.sh status - - Create: the new pipeline appears in by name, and (for a new repo) the provider-specific flags were supplied (
sf devops pipeline list --jsonfor GitHub,--repo-ownerfor Bitbucket)--bitbucket-workspace - Add-stage / add-environment: the stage exists in the chain and passed
--org-type(scripts/validate-org-type.sh)scripts/verify-operation.sh has-stage ... - Attach-project: the project shows in (
.result.connectedProjects[])scripts/verify-operation.sh has-project ... - Activate: passed beforehand and
scripts/check-activation-ready.shis now.result.isActive(true)scripts/verify-operation.sh active <id> true - Delete-environment: the pipeline was inactive before the delete
确认所执行操作对应的所有项均已完成。所有适用项均满足后,方可报告成功:
- 所有命令均使用
sf devops参数,且返回--json(通过status: 0验证)scripts/verify-operation.sh status - - Create操作:新流水线通过名称出现在中,且(针对新仓库)已提供特定提供商的必填参数(GitHub的
sf devops pipeline list --json,Bitbucket的--repo-owner)--bitbucket-workspace - Add-stage / add-environment操作:阶段存在于链中,且通过
--org-type验证(通过scripts/validate-org-type.sh验证)scripts/verify-operation.sh has-stage ... - Attach-project操作:项目显示在中(通过
.result.connectedProjects[]验证)scripts/verify-operation.sh has-project ... - Activate操作:执行前已通过,且
scripts/check-activation-ready.sh现在为.result.isActive(通过true验证)scripts/verify-operation.sh active <id> true - Delete-environment操作:删除前流水线处于停用状态
Rules / Constraints
规则/约束
| Constraint | Rationale |
|---|---|
All sf devops commands must use | Structured output is required for headless consumption; human-readable output is unreliable for parsing |
| A pipeline requires a Git repo at create time | |
| New-repo create needs provider-specific flags | GitHub requires |
| Pipeline ID required for get, update, and all stage/environment/project ops | These commands identify the pipeline only by |
Stage IDs come from | |
| Stages carry no environment until one is added; build the chain by anchoring to the following stage |
| The flag is a fixed enum; other values fail |
| Pipeline must have ≥1 stage before activation | |
| Do not modify stages after activate + promote | DevOps Center locks stage structure once changes have been promoted through an active pipeline |
| Environment delete requires an inactive pipeline | |
| A project attaches to only one pipeline | |
| Idempotent create via check-before-create | The CLI does not dedupe; list existing pipelines and return the match instead of erroring |
Prefer | |
| 约束 | 理由 |
|---|---|
所有sf devops命令必须使用 | 结构化输出是无头场景消费的必要条件;人类可读输出解析不可靠 |
| 创建流水线时必须关联Git仓库 | |
| 创建新仓库时需要特定提供商的参数 | GitHub需要 |
| get、update以及所有阶段/环境/项目操作需要流水线ID | 这些命令仅通过 |
阶段ID来自 | |
| 阶段在添加环境前无关联环境;通过锚定到后续阶段来构建阶段链 |
| 该参数为固定枚举值;其他值会导致命令失败 |
| 激活流水线前必须至少包含一个阶段 | |
| 激活并完成晋升后请勿修改阶段 | DevOps Center会在激活流水线并完成晋升后锁定阶段结构 |
| 删除环境需要流水线处于停用状态 | |
| 一个项目只能附加到一条流水线 | 若项目已附加到其他流水线, |
| 通过先检查再创建实现幂等性 | CLI不会自动去重;列出现有流水线并返回匹配项,而非报错 |
无头运行中优先使用 | |
Gotchas
常见问题
| Issue | Resolution |
|---|---|
| No default org set | Run |
| Create fails — missing repo | |
| New-repo create fails — missing provider flag | GitHub new repo needs |
| |
| Environment add hangs in CI | The OAuth browser flow blocks headless runs; add |
| Activation rejected | The pipeline needs at least one stage; add a stage (and its environment) before |
| Cannot modify stages | The pipeline is active and has promoted changes; stage structure is locked — configuration must complete before activation |
| Environment delete fails | The pipeline is active; deactivate with |
| Project already attached | A project attaches to only one pipeline; detach from the other pipeline first via |
| Pipeline / stage / project not found | The ID is invalid; run |
| 问题 | 解决方案 |
|---|---|
| 未设置默认组织 | 先运行 |
| 创建失败——缺少仓库参数 | |
| 创建新仓库失败——缺少提供商参数 | 新GitHub仓库需要 |
| |
| CI环境中添加环境操作挂起 | OAuth浏览器流程会阻塞无头运行;添加 |
| 激活被拒绝 | 流水线需要至少一个阶段;激活前添加阶段(及其环境) |
| 无法修改阶段 | 流水线已激活且已完成晋升;阶段结构已锁定——需在激活前完成配置 |
| 删除环境失败 | 流水线处于激活状态;先通过 |
| 项目已附加 | 一个项目只能附加到一条流水线;先通过 |
| 流水线/阶段/项目未找到 | ID无效;运行 |
Output Expectations
输出预期
Deliverables vary by operation:
- List: pipelines with ID, name, and active state (no stages/projects in the list view)
- Get: a pipeline with ID, name, active state, its stage chain (each with environment and branch, ordered via ), and connected projects
nextStageId - Create: pipeline ID, name, and linked repository (or the pre-existing pipeline on idempotent match)
- Stage op: the updated ordered stage chain
- Environment op: the stage with its bound environment (name, org-type)
- Project op: confirmation of attach/detach
- Lifecycle: the new active state and/or pipeline name
Outputs are derived from and CLI commands.
sf devops pipelinesf devops stage交付内容因操作而异:
- List操作:流水线的ID、名称和激活状态(列表视图中不包含阶段/项目)
- Get操作:流水线的ID、名称、激活状态、阶段链(每个阶段包含环境和分支,按排序)以及关联项目
nextStageId - Create操作:流水线ID、名称和关联仓库(若为幂等匹配则返回现有流水线)
- 阶段操作:更新后的有序阶段链
- 环境操作:绑定了环境的阶段(名称、org-type)
- 项目操作:附加/分离的确认信息
- 生命周期操作:新的激活状态和/或流水线名称
输出内容均来自和 CLI命令。
sf devops pipelinesf devops stageCross-Skill Integration
跨技能集成
| Delegate to | When |
|---|---|
| The user wants to create or advance work items once the pipeline is active |
If a project the user wants to attach can't be found, resolve or list existing projects with (see ) rather than delegating — project creation is out of scope for this skill.
sf devops project list --jsonreferences/parsing-patterns.md| 委托至 | 场景 |
|---|---|
| 用户想要在流水线激活后创建或推进工作项 |
如果用户想要附加的项目无法找到,可通过解析或列出现有项目(参考),而非委托——项目创建不属于此技能的范围。
sf devops project list --jsonreferences/parsing-patterns.mdReference File Index
参考文件索引
| File | When to read |
|---|---|
| When you need detailed CLI flag documentation and JSON output schemas for each |
| When you need jq snippets to parse the JSON (stage chains, pipeline/project ID resolution), error-handling reference, the check-before-create idempotent pattern, or auth requirements |
| When the user's request matches a common pattern (end-to-end pipeline setup, inserting a stage, binding an environment, attaching a project, activation) |
| Run before |
| Run before |
| Run in Phase 3 to assert a command's JSON status and post-state fields ( |
| 文件 | 阅读场景 |
|---|---|
| 需要每个 |
| 需要jq代码片段解析JSON(阶段链、流水线/项目ID解析)、错误处理参考、先检查再创建的幂等模式或认证要求时 |
| 用户请求匹配常见模式(端到端流水线设置、插入阶段、绑定环境、附加项目、激活)时 |
| 在 |
| 在 |
| 在阶段3中使用,断言命令的JSON状态和操作后的状态字段( |