TeamCity Slack Notifier

by: Jason

We love TeamCity here at Tapadoo. We use it to automatically build and deploy new iOS & Android app betas both internally for testing and to externally to clients. We’ve been using Slack lately as a replacement for Jabber and Mail for internal comms which don’t scale well, and its been awesome.

Slack has many cool integrations with other tools like bug trackers, Github, bitbucket and even some for CI servers like Travis, but none (yet) for our favourite, TeamCity. I liked the idea of automated posts arriving in the general channel as new betas went live. It could be a fun way to let everyone know progress was being made as the day went on. It’s easy to forget the little Mac Mini is playing an important role. Sure, developers would get their own personal success and fail messages via email if they wished, but unless you told someone, know one else had a sense of activity unless they loved checking out the TeamCity dashboard.

TeamCity has a plugin API apparently – Java based, and slack supports incoming webhooks allowing to to post anything you’d like, so with a little bit of free time between tasks, I decided to give it a go. I read some examples, hacked up a custom notifier class, zipped it up with some meta data, and a plugin was born:

Builds arriving in slack

Builds arriving in slack

 

Success! The messages started to trickle in. successes only, by design. Let the rest of the team feel happy some bugs where fixed. Just the name of the build, and who did it. I spared people the public humiliation of a failure (for now).

Sure, a few shortcuts were taken. I probably hard coded a few more strings and URLs than I should have. I may have used string concatenation instead of proper JSON classes to construct a payload, but it didn’t matter. Our little build server found its voice and started contributing to the teams banter.

It’s not without it’s flaws, please forgive the occasional naughty shortcut, but if you want to get in on the action we’ve stuck it up on Github : TCSlackNotifierPlugin , and of course, pull requests are welcome.

In the mean time, check out Slack. They even have a free plan with limited storage and integrations to get you properly hooked. I’m already scheming to see what other tools I can integrate.

 

current notification setup

current notification setup

 

You May Also Like

Top Tips for Gathering In-App Feedback

Top Tips for Gathering In-App Feedback

Developing an app is never a finished product. There are always tweaks that can be made to improve the user experience and make it a better and more desirable product. But whatever changes you make to your app you want to make sure that they are in line with what...

read more
6 Ways to Improve your Apps User Experience

6 Ways to Improve your Apps User Experience

Is your mobile app suffering from "everything but the kitchen sink" syndrome? We often find when working with new clients on their user experience design strategy that they start with an ambitious goal for their app. They want 'everything but the kitchen sink'! While...

read more
3 Best Mobile App A/B Testing Tools

3 Best Mobile App A/B Testing Tools

We spoke about the best practices in mobile app A/B testing in our last post. Here we cover three of the best mobile app A/B testing tools. These tools allow you to run experiments that improve the design of your app while increasing conversion rates. By running these...

read more

5 Comments

  1. Avatar

    Hi, Jason!
    I have a problem with TCSlackNotifier. I’am using TeamCity 8.1.4. When I load a plugin, it appears in plugins list, but did’n’t appear in My Settings & Tools. Maybe, this version of the server does not support this plugins UI?
    Clarify please, what sort of token is using in main-config.xml? User’s token or token of integration ?

    Thanks

    Reply
  2. Avatar

    Took a bit of work to get it running, but it works a charm on TeamCity 9.0.4.

    Thanks for publishing this!

    Reply
  3. Avatar

    I have the same issue with TCSlackNotifier. TeamCity 9.0.3. It appears in plugins list, but did’n’t appear in My Settings & Tools. I’ve been waiting for a couple of hours, but still didn’t see it shows up on My Settings & Tools. What else can I do or check?

    Thanks

    Reply
    • Avatar

      the issue is resolved by using slack webhooks.

      Reply
  4. Avatar

    Is it possible to enable slack to post compile error messages formatted with

    ##teamcity[message text=’Compilation error’ errorDetails=’my details’ status=’ERROR’])

    The only messages I get are commits, Success and Failed builds. I would like to report compile errors too

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *