Upsource 3.0 Help

CI server integration

On this page:

Integration with a CI server allows Upsource to receive and display built 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:

CI_build_status_rev_list

Receiving build statuses from TeamCity

Integrating with a TeamCity CI server is provided via a Commit Status Publisher plugin which comes bundled with the latest version of TeamCity. Configuring it to work with Upsource is easy and is done on the TeamCity side.

To integrate with TeamCity

  1. Make sure you have administrator access rights to the project in TeamCity.

  2. Go to Settings | Build features | Add build feature

  3. 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
  4. 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

The POST request body should include the following fields:

ParameterRequiredDescription
keyYesBuild key - a unique build identifier (e.g. PROJECT-VERSION-1234)
stateYes

Indication of the build status:

  • in_progress: a build for the commit is not yet complete

  • failed: a build for the commit failed

  • success: a build for the commit completed successfully

urlYesBuild URL
nameNoBuild name (usually the same as Build key)
descriptionNoBuild details (e.g. "15 tests out of 800 are failing")
projectYesProject ID in Upsource
revisionYesCommit ID in Upsource
revisionMessageNoCommit message
revisionAuthorNoCommit author
revisionDateNoUnix timestamp
Last modified: 8 November 2016