Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

teamcity-build-scan-plugin

The work on this software project is in no way associated with my employer nor with the role I'm having at my employer. Any requests for changes will be decided upon exclusively by myself based on my personal preferences. I maintain this project as much or as little as my spare time permits.

Overview

TeamCity plugin that integrates with build scans for Gradle and Maven. Build scans are available as a free service on scans.gradle.com and commercially via Gradle Enterprise.

For each Gradle and Maven build that is run from TeamCity, this plugin exposes the links to the created build scans in the TeamCity UI.

The plugin is hosted at Bintray's JCenter.

Build scan

Recent build scan: https://scans.gradle.com/s/cv4z5js6g6xga

Find out more about build scans for Gradle and Maven at https://scans.gradle.com.

Version compatibility

This plugin requires that you use at least Gradle Enterprise Gradle plugin 3.0 or Gradle Build Scan plugin 1.8 in your Gradle builds, or Gradle Enterprise Maven extension 1.0 in your Maven builds.

It is recommended that you use the latest Gradle Enterprise Gradle plugin version or latest Gradle Build Scan plugin version and the latest Gradle Enterprise Maven extension version at all times to get the most insights from your builds.

TeamCity build runner requirements

Gradle builds

If you use TeamCity's GradleRunner to launch your Gradle builds, there is nothing special to do.

If, and only if, you do not use TeamCity's GradleRunner to launch Gradle builds, apply the TeamCity build scan Gradle plugin to your Gradle builds in order to notify TeamCity about the build scans that were published while running a build.

If you do not use TeamCity's GradleRunner to launch Gradle builds and you do not apply the TeamCity build scan Gradle plugin to your Gradle builds, you can still get integration with build scans, but it requires your build logs being parsed for build scan links. In case of huge build logs, this can put a significant toll on the performance of your TeamCity instance. You can enable the parsing of the build logs by creating a TeamCity configuration parameter with name BUILD_SCAN_LOG_PARSING and setting the value to true.

Maven builds

If you use TeamCity's MavenRunner to launch Maven builds, there is nothing special to do.

If you do not use TeamCity's MavenRunner to launch Maven builds, you can still get integration with build scans, but it requires your build logs being parsed for build scan links. In case of huge build logs, this can put a significant toll on the performance of your TeamCity instance. You can enable the parsing of the build logs by creating a TeamCity configuration parameter with name BUILD_SCAN_LOG_PARSING and setting the value to true.

Installation

  1. Download the plugin .zip file from https://bintray.com/etienne/teamcity-plugins/teamcity-build-scan-plugin (see Downloads section at the bottom of the page).

  2. Go to the plugin list of your TeamCity installation at <TeamCityInstanceRootUrl>/admin/admin.html?item=plugins and click on the link Upload plugin zip to install the previously downloaded plugin .zip file.

  3. Restart TeamCity.

  4. Trigger your Gradle builds with build scans enabled.

  5. Find the links of the published build scans in the Overview section of each TeamCity build.

Slack Integration

  1. In Slack, create a webhook and keep track of the created URL.

  2. In TeamCity, on the build configuration for which you want to be notified about published build scans, create a configuration parameter with name BUILD_SCAN_SLACK_WEBHOOK_URL and the value being the URL of the webhook created in step #1.

  3. Trigger your Gradle builds with build scans enabled.

  4. Find a notification about the published build scans in the Slack channel configured in the webhook.

Feedback and Contributions

Both feedback and contributions are very welcome.

Acknowledgements

  • facewindu (pr #21 that includes init script test coverage)
  • dmitry-treskunov (bug report and proposed fix)
  • pbielicki (pr #17 that adds a hint to the BuildScanServiceMessageMavenExtension @Component)
  • jonnybbb (pr #14 and #15 that store build scan links under artifacts and clean up legacy data)
  • davidburstromspotify (bug report and proposed fix)
  • guylabs (pr #10 that provides support for the Gradle Enterprise Gradle plugin)
  • autonomousapps (pr #9 that provides build scans for Maven builds)
  • mark-vieira (pr #6 that provides message service functionality)
  • pavelsher (several code pointers)

License

This plugin is available under the Apache License, Version 2.0.

(c) by Etienne Studer