名称: 比较 描述: 比较两个版本的 Starlake 项目
比较技能
比较两个版本的 Starlake 项目并生成差异报告。支持通过文件路径、Git 提交 SHA 或 Git 标签进行比较。适用于审核 schema 变化、添加/删除表以及修改配置,便于发布版本之间的对比。
用法
starlake compare [options]
选项
通过文件路径
--path1 <value>: 旧版本项目的路径--path2 <value>: 新版本项目的路径
通过 Git 提交
--gitWorkTree <value>: Git 仓库的本地路径--commit1 <value>: 旧提交 SHA--commit2 <value>: 新提交 SHA
通过 Git 标签
--tag1 <value>: 旧 Git 标签(使用latest表示最新标签)--tag2 <value>: 新 Git 标签(使用latest表示最新标签)
输出
--template <value>: 自定义报告格式的 SSP/Mustache 模板路径--output <value>: 输出文件路径--reportFormat <value>: 报告输出格式:console、json或html
示例
比较 Git 提交
starlake compare --gitWorkTree /path/to/repo --commit1 abc1234 --commit2 def5678
比较 HEAD 与上一个提交
starlake compare --gitWorkTree . --commit1 HEAD~1 --commit2 HEAD
比较 Git 标签
starlake compare --gitWorkTree . --tag1 v1.0.0 --tag2 v2.0.0
与最新标签比较
starlake compare --gitWorkTree . --tag1 latest --commit2 HEAD
比较两个目录路径
starlake compare --path1 /old/project --path2 /new/project
使用自定义模板比较
starlake compare --gitWorkTree . --commit1 HEAD~1 --commit2 HEAD --template /path/to/report.ssp --output /tmp/report.html