TeamCity Plugin Template

Do you like to create a plugin for TeamCity. For me it's me best way to implement new feature for TeamCity. We are working in the direction to put mostly all new functionality as plugins. In this post I'll describe my approach on how one can setup a project to develop new plugin for TeamCity.

A plugins may have several parts

  • Server-Side - code that is running in TeamCity server
  • Agent-Side - code that is running on all build agents

My sample now only covers server-side plugins.

Features inside

  • Pre-set number of project libraries to simplify development
  • Artifact 'plugin-zip' that creates a TeamCity plugin .zip file
  • Artifact 'deploy' that copies created plugin into TeamCity data directory
  • Artifact 'idea-resolve-helper' that is used to make IDEA resolve all jsp custom tags that you may want to use in plugins
  • Run configuration 'Tomcat-6-TeamCity'. You may use this configuration to make IDEA run debugging of TeamCity server with your plugin deployed inside.

Initialize environment

The project is created in Intellij IDEA 12 EAP. To run debugging of tomcat server with your plugin you may need to have Ultimate edition

First you need to checkout PluginTemplate project from Git/GitHub.

https://github.com/jonnyzzz/TeamCity.PluginTemplate

Check project readme to find instructions to update necessary names in the plugin.

Project uses TeamCityDistribution environment variable as path to TeamCity installation directory (from .exe installed or unpacked .tar.gz).

You need to add a tomcat application server in IDEA settings. The easiest way to to use tomcat that is bundled under TeamCity distribution

Future Work

In the next post I'll describe some number of tricks I used to make it work.

Have fun!

If you use this template project, please let me know!

comments powered by Disqus