Skip to content

Upgrading from tcWebHooks 0.9.x.x to 1.1.x.x

netwolfuk edited this page Nov 12, 2018 · 17 revisions

The tcWebHooks 1.1 version adds many new features. Upgrading should be seamless and is well unit tested. See Installing for more information on how to install the plugin.

If you want to take a backup before upgrading, all webhook configuration is stored in the plugin-settings.xml files on the server. Either backup all these files (there is one in each project folder inside BuildServer/config/*), or simply zip up or copy the whole BuildServer/config/ folder itself.

From 1.1, the plugin is formed of two zip files:

  1. tcWebhooks-1.1.x.x.zip - The base plugin.
  2. tcWebHooks-REST-API-1.1.x.x.zip - The REST API for template editing.

The second plugin is only required when editing templates.

The following is a list of new features in 1.1.x.x

The webhook formats in 0.9 contain a lot of data, most of which is probably not necessary to be sent to your webhook endpoint. Templates allow the creation of specific payloads, which can then be re-used across multiple webhooks.

Editing templates has a simple UI

There are also some templates bundled with the 1.1 release. The old webhook 0.9 payload formats are still available and are labelled as Legacy WebHook formats. Any webhooks configured in 0.9 will be automatically converted to use the equivalent legacy format.

WebHook History Events

The WebHooks tab on the Project Overview and Build Overview pages show configured webhooks and now also show recent webhook execution events. Project WebHook History There is also a history page showing all webhook events, which can be accessed from the WebHooks tab in the TeamCity Administration section. WebHook History Page

Added sections to TeamCity Administration Pages

Both WebHooks and WebHooks REST API have entries in the Server Administation area of TeamCity. These pages confirm that plugins are installed correctly, and also provide links to the WebHook Templates and WebHook History pages. WebHook Tab in TeamCity Administration section WebHook REST API page in TeamCity Administration section

Added a WebHook section to the Project Settings pages

In addition to viewing webhooks on a tab on the Build Overview and Project Overview pages, webhooks are also shown in the Project Settings pages. All these show an overview of the configured webhooks and provide links to the WebHooks Editing screen. Webhooks section in Project Settings

Embedded test endpoint

Create a webhook and point it at http://your_teamcity_server/webhooks/endpoint.html This shows you the headers and body sent by your webhook. Testing Endpoint and Viewer

Testing webhooks (without running a build)

It is possible to test a webhook configuration without having to run a build, and even possible to test changes to a webhook before it is saved. Preview and execute a webhook before saving it

It's also possible to test a template during editing Preview and test WebHook Template Edits

Trigger Filtering applies a regular expression (regex) match before executing a webhook. Filters are defined by editing the plugin-settings.xml file on the server like the following example:

	  <trigger-filters>
	  	<filter value="${branchDisplayName}" regex="^master$" enabled="true"/>
	  	<filter value="${buildInternalTypeId}" regex="^bt\d$" enabled="true"/>
	  </trigger-filters>

Add custom headers to a webhook request by adding a <headers> element to the plugin-settings.xml file.

An example configuration:

      <headers>
        <header name="my-header-showing-build-name" value="${buildName}" />
      </headers>

Version 1.1.x.x adds a UI for editing authentication settings, and support for both Basic Authentication and Bearer Authentication methods. WebHook Authentication UI