You will need roughly 2 minutes to read this article.
The Codeship API v2 provides a number of ways for you to programmatically interact with your projects on Codeship.
The API is focused on solving a specific set of core use cases:
With the above scenarios as a guide, there are these specific endpoints:
For projects, you’re able to do most CRUD operations which should allow you to automate most of your project maintenance tasks; especially useful for those with 10s or 100s of projects. There is currently no delete action on projects.
Builds can’t be deleted, but otherwise you can do most anything with them. You can even go a level deeper than what the Codeship UI offers. If you restart a build, the old build data is kept around, but the UI only shows the latest. With the builds endpoint you can get the information on those old builds as well.
In terms of
commands on the builds endpoint, we’ve deviated slightly from “textbook REST” and have allowed endpoints to
/restart an existing build or
/stop a running build. If you want to trigger a build that pulls the latest code from a given branch, you would POST to the
/builds endpoint with the project and the branch in question. More details can be found on this in the API v2 documentation.
The Go library is released with the MIT license, so feel free to use it as you will. If you have suggestions, bugs or otherwise want to contribute to the project, please use the GitHub issues to submit these (or submit a PR).
Contact our support team or post on Stack Overflow using the tag
#codeship. Did you check the status page and changelog?
There are also several code examples and sample projects available for you to get started with.