Skip to content
netwolfuk edited this page Apr 15, 2018 · 16 revisions

Installing

tcWebhooks is packaged as a zip file in the normal TeamCity plugin format.

Download the plugin(s)

Since version 1.1-alpha11, there are two plugins that can be installed.

  1. tcWebHooksPlugin - main WebHooks functionality
  2. tcWebHooksPlugin-REST-API - API for editing WebHook Templates. Required for Template editing UI.

Recent releases are on GitHub. Older releases are on the tcPlugins download page on Sourceforge.

Copy the downloaded zip file(s) onto your TeamCity server.

There are two ways to accomplish this:

1. Upload the plugin using the TeamCity WebUI
  • Go the Adminstration page in TeamCity, click plugins (bottom of left menu).
  • Upload the new plugin zip file. If you have a previous version of the tcWebHooks plugin installed, you can remove it by clicking the name and choosing Delete next to the file name.
  • Restart your Teamcity instance to reload all plugins.
2. Or copy the plugin to the TeamCity server
  • Copy the zip file to the .BuildServer/plugins/ folder (directory). Unless you have overridden the default BuildServer directory, it will be $HOME/.BuildServer/plugins/
  • Remove any previous versions of the plugin by deleting the old zip file.
  • Restart your Teamcity instance to reload all plugins.

Fixing a JAXB jar conflict with the REST API.

If the tcWebHooksPlugin-REST-API has been installed, there is a jar conflict with the TeamCity REST API plugin.

  • After the tcWebHooksPlugin-REST-API plugin has been installed and teamcity has restarted
  • Go to the Administration section in teamcity. If the conflict is present, there will be a yellow bar at the top warning that Editing WebHook Templates via the REST API may fail.
  • Click the More info link and clean the plugins.
  • You will then need to restart TeamCity as soon as possible. See Fixing-the-REST-API-Jar-Conflict for more details.

Adding/Editing WebHooks.

tcWebHooks adds new tabs in a number of places for viewing - and subsequently editing - Webhooks.

Webhooks can be viewed by clicking the WebHooks tab on any Build Home page, Project Home page, or Build Result page. WebHooks also appears in the drop down list next to any build in the Project Home page. WebHooks are configured on a dedicated page. This page can be accessed by clicking the edit project webhooks link when viewing webhooks.

Any user that has Permission.VIEW_PROJECT permission on a project can see the tabs. Editing of webhooks is only possible if one's account has Permission.EDIT_PROJECT associated with that particular TeamCity Project.

When a WebHook is edited in the UI, the configuration is persisted to the server and stored in the plugin-settings.xml file belonging to that project. The UI does not support all possible configuration settings yet. For more information about the configuration file see Advanced editing of webhooks configuration

Logging and History

The tcWebHooks plugins logs to teamcity's teamcity-server.log file. When the plugin starts, you should see log entries similar to the messages below.

INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Starting 
INFO -   jetbrains.buildServer.SERVER - WebHookListener :: Starting 
INFO -   jetbrains.buildServer.SERVER - WebHookListener :: Registering 
INFO -   jetbrains.buildServer.SERVER - WebHookProjectSettingsFactory :: Registering 
INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Registering payload nvpairs with rank of 15 
INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Registering payload json with rank of 10 
INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Registering payload tailoredjson with rank of 9 
INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Registering payload xml with rank of 8 
INFO -   jetbrains.buildServer.SERVER - WebHookPayloadManager :: Registering payload empty with rank of 5 

You can obtain further information about tcWebHooks by enabling debug mode in log4j. Please see the TeamCity guide on how to adjust teamcity's logging level.

Since 1.1alpha14, one can see recent error results of a webhook execution from the WebHooks tab on the TeamCity admin, or more history on the /webhooks/history.html?view=all page (linked to from the Admin section).