GitLabCI通过API通过提交哈希或构建ID开始构建

时间:2015-07-27 06:43:21

标签: gitlab gitlab-ci gitlab-7

请帮帮我。在论坛上没有答案((我可以通过API重试GitlabCI中的构建吗?在Gitlab上通过提交哈希重建构建或在GitlabCI中构建id。就像在GitlabCI web中按下按钮一样

我尝试使用提交api进行init new build http://doc.gitlab.com/ci/api/commits.html,但我不明白如何在json请求中填充data对象。

请告诉我如何使用GitlabCI REST API通过提交哈希进行构建或重建?

我非常感谢您提供的任何帮助。

1 个答案:

答案 0 :(得分:0)

解决。对http://http://somegitlab/api/v1/commits?project_id=yourpojectId&project_token=yourproject令牌使用有效请求: { "data":{ "before": "c3c39b43f160c2efed5bbc16d15e91eab3c2ec22",<-- not required "after": "5539ffc98f07777b6360e976cbc7a796bb61e315", "ref": "refs/heads/master", "commits": [{ "id": "5539ffc98f07777b6360e976cbc7a796bb61e315", "message": "fixes #1 complete:1 and 3 sum output", <-- not required "timestamp": "2011-12-12T14:27:31+02:00", <-- not required "url": "http://somegitlab/sonmeproject/somecommit", <-- not required "author": { "name": "Kirill Tilkachev", "email": "lavcraft@gmail.com" } } ] } }

相关问题