Reputation: 1039
I´m working with my own GitLab and GitLab CI server. I´d like to get the latest success commit.
I just can get my latest build status off a branch from the URL:
http://mygitlab.ci/projects/3/status?ref=master
I need that in order to deploy the latest success version of my repo, but I really don´t understand CI with own GitLab and there are not a lot of documentation.
UPDATE:
i.e. In the picture you can see the latest 3 commits and their status. I really need to get the latest success commit (763a3077).
Upvotes: 5
Views: 3254
Reputation: 1039
Solved:
Here I have the answer. The URL must be something like this:
http://my.gitlabci/api/v1/commits?project_token=<my-project-token>&project_id=<my-project-id>
GET /commits
Parameters:
https://docs.gitlab.com/ee/api/commits.html
Upvotes: 3