# Create the pipeline first
teamcity pipeline create my-pipeline --project CLI
# Store a secret in the pipeline's project
teamcity project token put CLI_MyPipeline "my-api-key"
# Output: credentialsJSON:2d3c2507-4840-...
CLI CLI
├── CI CLI_CiCd ⬡ pipeline · 6 jobs
└── Build CLI_Build
管道生成的子项目和虚拟构建类型会自动隐藏。
运行视图
查看管道运行时,CLI 会显示管道名称并列出所有作业:
teamcity run view 5800
✓ CI ⬡ 5800 #727 · main
Triggered by vcs · 3h ago · Took 8m 17s
Pipeline Jobs:
lint Lint (build 5801)
test_linux Test Linux (build 5803)
goreleaser GoReleaser (build 5806)
运行树
teamcity run tree 检测流水线运行,并以状态摘要显示扁平化作业列表,而非通用依赖项树:
teamcity run tree 6708
作业列表
teamcity job list 默认隐藏 pipeline 主构建类型。 使用 --all 显示它们:
teamcity job list --project CLI # hides pipeline heads
teamcity job list --project CLI --all # shows everything
运行管道
可通过标准 run start 命令,并使用 pipeline 主构建类型 ID 触发管道运行:
teamcity run start CLI_CiCd
teamcity run start CLI_CiCd --watch