Appearance
徽章
徽章用于展示指标数据,通过颜色区分是否达标。
云原生构建相关徽章
徽章访问路径
云原生构建产生的徽章访问路径:
- precise:
https://cnb.cool/{group}/{repository}/-/badge/git/{sha}/{metrics} - latest:
https://cnb.cool/{group}/{repository}/-/badge/git/latest/{metrics} - 分支 latest:
https://cnb.cool/{group}/{repository}/-/badge/git/latest/{metrics}?branch={branch}
参数含义
group:仓库所在组织路径repository:仓库名sha: CommitId 前 8 位latest:未指定 branch 时获取默认分支最新徽章;指定 branch 时获取该分支最新 commit 对应的徽章metrics: 指标名,如ci/status/push,表示 push 事件触发的构建耗时branch: 分支名,如main,仅在 sha 为 latest 时生效
徽章类型
云原生构建时会自动上传相关构建指标的徽章数据:
1. Git 事件
ci/status/pushpush 事件构建耗时与状态ci/status/commit.addcommit.add 事件构建耗时与状态ci/status/branch.createbranch.create 事件构建耗时与状态ci/status/pull_requestpull_request 事件构建耗时与状态ci/status/pull_request.updatepull_request.update 事件构建耗时与状态ci/status/pull_request.targetpull_request.target 事件构建耗时与状态ci/status/pull_request.mergedpull_request.merged 事件构建耗时与状态ci/status/tag_pushtag_push 事件构建耗时与状态
2. 准备工作区
ci/git-clone-yyds工作区大小与准备耗时
3. 流水线配置
ci/pipeline-as-code云原生构建的配置文件
4. 云原生开发
code/vscode-started准备开发环境耗时
5. 单元测试
使用内置任务 testing:coverage 可上报单元测试徽章数据
testing/unit/coverage单元测试全量覆盖率testing/unit/coverage-pr本次 pull_request 的单元测试增量覆盖率
6. 安全
security/tca腾讯云代码分析(TCA)
7. 定时任务
ci/status/crontab定时任务构建耗时与状态
仓库相关徽章
fork 徽章
用徽章形式展示仓库的 fork 数量: 访问路径:https://cnb.cool/{group}/{repository}/-/badge/fork
star 徽章
用徽章形式展示仓库的 star 数量: 访问路径:https://cnb.cool/{group}/{repository}/-/badge/star
部署环境徽章
用徽章形式展示仓库部署环境的最新部署状态和版本: 访问路径:https://cnb.cool/{group}/{repository}/-/badge/deploy?name={name}
Release 徽章
用徽章形式展示仓库最新 Release 的版本号: 访问路径:https://cnb.cool/{group}/{repository}/-/badge/release
markdown 中使用徽章
支持以下两种格式在 markdown 中以图片形式嵌入徽章:
- 带域名和仓库:
 - 不带域名和仓库,以
/-/badge/git开头的会被识别为徽章: