CI server integration
On this page:
Integration with a CI server (Continuous Integration server) allows Upsource to receive and display build statuses on a commit for a particular project.
When someone makes a commit and a build system runs the build, its status is displayed in the revision list, next to the commit. Since a single commit can sometimes initiate multiple builds, the commit can have more than one build status:
Receiving build statuses from TeamCity
Integrating with a TeamCity CI server is provided via a Commit Status Publisher plugin which comes bundled with the TeamCity version 9.1.7 and newer. Configuring it to work with Upsource is easy and is done on the TeamCity side.
To integrate with TeamCity
-
Make sure you have administrator access rights to the project in TeamCity.
-
Go to
. -
Choose Commit Status Publisher from the drop-down list.
-
Specify the following information:
- Publisher: JetBrains Upsource
- Upsource URL: the URL of your Upsource server
- Upsource project ID: the ID of your Upsource project
- Username, Password: administrator credentials of the Upsource project
-
Save your settings.
For more information refer to the TeamCity documentation
Receiving build statuses from other CI servers
Upsource comes with a Build Status Endpoint that is open to receive data as JSON payload at http[s]://your-upsource-server/~buildStatus/.
The POST request should include the following header: Content-Type: application/json; charset=UTF-8
If no credentials are provided, the request will be executed with guest permissions. To make a request on behalf of a specific user, send the Authorization header along with your request: Authorization: Basic login:password
Substitute login:password with the actual credentials, encoded in Base64.
The POST request body should include the following fields:
Parameter | Required | Description |
---|---|---|
"key" | Yes | Build key — a unique build identifier (e.g. PROJECT-VERSION-1234) |
"state" | Yes | Indication of the build status:
|
"url" | Yes | Build URL |
"name" | No | Build name (usually the same as Build key) |
"description" | No | Build details (e.g. "15 tests out of 800 are failing") |
"project" | Yes | Project ID in Upsource |
"revision" or ["revision", "revision", "revision"] | Yes | Revision ID or a JSON array of revision IDs |