如何让 travis 通过 API 调用重建分支?
How to get travis to rebuild a branch via an API call?
我有一个存储库(称为 A),它利用另一个存储库(称为 B),当我推送到存储库 A 时,存储库 A 在 Travis 上重建。我还希望当 Repo B 被推送到时,它会触发一个 webhook 到 travis,在 travis 上重建 Repo A。
使用 Circle CI,就像在 Repo B 上添加这个 webhook 一样简单:
https://circleci.com/api/v1/project/me/myrepoA/tree/master?circle-token=token
但是我找不到 Travis CI 的等效项。
Travis 说明在这里http://docs.travis-ci.com/user/triggering-builds/
卷曲示例:
curl -X POST \
-H "Content-Type: application/json" \
-H "Travis-API-Version: 3" \
-H "Accept: application/json" \
-H "Authorization: token xxxxxx" \
-d '{"request": {"branch": "master"}}' 'https://api.travis-ci.org/repo/balupton%2FmyrepoA/requests'
为了制作 {slug|id} 我们需要在用户和 repo 之间放置 %2F
示例:twbs%2Fbootstrap
我有一个存储库(称为 A),它利用另一个存储库(称为 B),当我推送到存储库 A 时,存储库 A 在 Travis 上重建。我还希望当 Repo B 被推送到时,它会触发一个 webhook 到 travis,在 travis 上重建 Repo A。
使用 Circle CI,就像在 Repo B 上添加这个 webhook 一样简单:
https://circleci.com/api/v1/project/me/myrepoA/tree/master?circle-token=token
但是我找不到 Travis CI 的等效项。
Travis 说明在这里http://docs.travis-ci.com/user/triggering-builds/
卷曲示例:
curl -X POST \
-H "Content-Type: application/json" \
-H "Travis-API-Version: 3" \
-H "Accept: application/json" \
-H "Authorization: token xxxxxx" \
-d '{"request": {"branch": "master"}}' 'https://api.travis-ci.org/repo/balupton%2FmyrepoA/requests'
为了制作 {slug|id} 我们需要在用户和 repo 之间放置 %2F
示例:twbs%2Fbootstrap