Cloud & Engineering

Matt Corr

Displaying Team City build status in Octopus Deploy

Posted by Matt Corr on 18 February 2017

Octopus, Team City, Blog, Technology

Introduction

For our on-premises deployment of our integration applications, Mexia often look for the ideal tools to utilise to deliver the best value for our clients and to minimise time/effort wastage and provide developers a pleasant experience.

A combination we find that works well for Integration projects is TeamCity and Octopus Deploy. For DLL projects, WCF Services and even BizTalk applications, these two tools work well for their respective build and deployment tasks and work well together.

I am always looking for ways to improve the integration between these tools and would like to share something I discovered recently.

What has worked in the past?

Previously I used to have a URL to the Team City Project page in the description for the Octopus Project that was deploying the Team City packages. This was okay, but looking at web links is not very proactive. In order to see the details, you needed to click the link and most people won't bother.

A more pro-active approach

While browsing the TeamCity REST API recently, I discovered that you can get a build status icon to display on a webpage. It has been around for a little while as there was a blog post by JetBrains back in 2012 about it! So now when we look at our Projects page we see something like this:

Octopus Project view

This is much more useful, and allows us to see at a glance from Octopus if there are any builds that need attention in Team City.

So how to link that up?

In Octopus Deploy, go to the Description field for an existing or a new Project. You can put in whatever you want in Markdown format, but include the following code:

[<img src="http://TEAMCITY_SERVER/app/rest/builds/aggregated/strob:(buildType:(project:(id:PROJECT_ID)))/statusIcon.svg"/>](http://TEAMCITY_SERVER/project.html?projectId=PROJECT_ID&tab=projectOverview)

This will display a clickable badge in the description. So, if you see a build failing, you can just click on it and you will be taken to the Project page in Team City.

 

Octopus Project Settings

There are some tokens that need replacing first before it will work.

Both of the tokens below will need to be replaced twice in the code snippet above.

 

TEAMCITY_SERVER - Your TeamCity server URL port.

PROJECT_ID - The TeamCity Project Id. (See below highlighted in yellow for where to obtain the Project Id.)

 

Where to find the ProjectId

 

There you have it, a quick and easy way to make connectivity between two popular tools just that little bit more useful! Happy deploying!

 

If you like what you read, join our team as we seek to solve wicked problems within Complex Programs, Process Engineering, Integration, Cloud Platforms, DevOps & more!

 

Have a look at our opening positions in Deloitte. You can search and see which ones we have in Cloud & Engineering.

 

Have more enquiries? Reach out to our Talent Team directly and they will be able to support you best.

Leave a comment on this blog: