GitLabCI start build by commit hash or build id through API

398 Views Asked by At

Help me please. There is no answer at forums (( Can I retry build in GitlabCI through API? Retry build by commit hash at Gitlab or build id in GitlabCI. Like button pressed in GitlabCI web

I try to use commits api for init new build http://doc.gitlab.com/ci/api/commits.html, but i dont understand how to fill data object in json request.

Tell me please how to make build or rebuild by commit hash with GitlabCI REST API?

I really appreciate any help you can provide.

1

There are 1 best solutions below

0
On

Solved. Use valid request to http://http://somegitlab/api/v1/commits?project_id=yourpojectId&project_token=yourproject token: { "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": "[email protected]" } } ] } }