Release

Endpoint POST /api/v1/releases

从部署流水线调用它(或使用 blipit releases new)。项目上保存了 GitHub token 时,Blipit 会自行获取 commit;否则使用你发送的 commit。

1请求

私密密钥放在 X-Blipit-Key 中。请求体最大 2 MB:version(必填,最多 256 个字符)、commit 和 previous_commit(git sha,7 到 40 位十六进制)、repo(owner/name)、commits(可选,来自 git log 的列表:sha、message、author、变更文件,最多 250 个)。没有 previous_commit 时,Blipit 保留上一个 release 的 commit 之后的 commit,首个 release 则只保留 head。

sh
curl https://in.blipit.io/api/v1/releases \
  -H "Content-Type: application/json" -H "X-Blipit-Key: <secret key>" \
  -d '{"version":"shop@1.4.2","commit":"9fceb02a","previous_commit":"3a1c7f0d","repo":"acme/shop"}'

2响应

200 {version, commits, source (github、cli 或 null), previous_commit, warning?}。warning 表示 GitHub 查询失败并使用了 CLI 发送的 commit。400 表示 version、sha 或 repo 无效。401 未知密钥,403 公钥。

须知

  • repo 只能是 owner/name;包含 @、//、..、?、# 或额外路径段的都会被拒绝,因此 GitHub 调用只会到达 api.github.com/repos/owner/name。
  • GitHub compare 获取有 10 秒超时,并读取最新 30 个 commit 的变更文件。

遇到问题?发邮件至 support@blipit.io。每个项目的密钥和确切的 DSN 在 app.blipit.io 的“API 密钥”下。