Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

TeamCity Data Source

The TeamCity Data Source allows you to connect to your build pipeline to retrieve the artifacts stored.

Setting up your build pipeline

  1. Set up the compilation stats as a build artifact
  2. Take note of the Build configuration ID (refer to Configuring General Settings)

Setting up Danger pipeline

Note:

  • If you run danger in the same as the build pipeline, you'll need to use the MixedDataSource (TODO, currently not supported)
  • If you have a separate danger pipeline, ensure it is execute AFTER the build pipeline (as the build artifact needs to be available)
  • The %system.teamcity.auth.userId% and %system.teamcity.auth.password% values mentioned below are automatically created for TeamCity agents to communicate back with TeamCity server

Set up the following build parameters:

  • env.TC_USER with value %system.teamcity.auth.userId%
  • env.TC_PASSWORD with value %system.teamcity.auth.password%
  • env.TC_SERVER_URL with the value of your TeamCity server (for example, https://teamcity.company.com)

In your dangerfile.js:

import { danger as wbdDanger, TeamCityDataSource } from 'webpack-bundle-delta';

const { TC_USER, TC_PASSWORD, TC_SERVER_URL } = process.env;

wbdDanger({
  dataSource: new TeamCityDataSource({
    buildType: 'YourBuildId' /* from the build pipeline, the value on step 2 */,
    serverUrl: TC_SERVER_URL,
    username: TC_USER,
    password: TC_PASSWORD,
  }),
  baseSha: danger.github.pr.base.sha,
  headSha: danger.github.pr.head.sha,
});