DevOps: Configuring TeamCity for Ossum DevOps

Configuring TeamCity for Ossum DevOps

Requirements

TeamCity does not require extra git plugins to function with Ossum. Like a Jenkins setup, your TeamCity server needs to be accessible via URL from the Internet. You will need to provide Ossum with the URL it needs to access this server, as well as a username and password

Configure TeamCity

The Ossum DevOps feature will initiate jobs on your TeamCity server when commits happen or when merge requests are created or modified. It is up to you to create the jobs in TeamCity as well as configure TeamCity for what you want the job to do. Ossum will take care of initiating your job at the appropriate time.

Create a Project Hierarchy and Build Configuration

If you have not configured a Project and Build Configuration in TeamCity this is a good place to start. Begin by creating a Project off of the "root project" using the "Create subproject" button.

Project

Add Ossum Credentials to TeamCity

Creating a Project will take you to the page to configure your repository URL. To find the repository URL head to the Download tab under Code in Ossum. Add your Ossum repo, username, and password in TeamCity. These will be needed to clone/checkout your code.

Credentials

Verify TeamCity is able to connect to your Ossum repository.

Verify Connection

Move forward with configuring Ossum with the Build Configuration ID from TeamCity as the job to kick off.

The next step is to create your job(s) by configuring Build Steps in the Build Configuration Settings page. For more information on how to do this see Configuring Build Steps

Ossum passes parameters to the build. You do not have to use or even define the parameters, but they are available to be used by the build to decide what it should checkout and build, decide what the build should do, or as information the build sends out in its notifications.

The parameters that Ossum will send to TeamCity are the same ones from the Jenkins configuration section. Here they are again for a reminder of the parameters with recommended defaults and descriptions.

Name Type Recommend Default Description
ossum_merge_request Boolean false 'true' if this is a merge request to be verified, 'false' for a normal commit
ossum_revision String */master git sha of the change
ossum_refspec String refs/heads/master git refspec of the change
ossum_before_revision String   previous git sha (could be used with git log to get changelog of commits)
ossum_url String   URL to view commit or merge request in Ossum

And this is an example of parameter usage in a TeamCity build step.

TeamCity Build Step

Previous Article
DevOps: Configure Ossum DevOps Plugin

Next Article
DevOps: Configuring Bamboo for Ossum DevOps