def env = System.getenv()

if (env.CI && env.BUILD_ID && env.BUILD_SERVER_URL && env.BUILD_TYPE_ID && env.BUILD_URL) {
    buildScan.tag 'CI'
    buildScan.link "TeamCity Build", env.BUILD_URL
    buildScan.value "Build ID", env.BUILD_ID
}


def env = System.getenv()

if (env.TEAMCITY_VERSION) {
    def version = env.TEAMCITY_VERSION
    buildScan.tag 'CI'
    def guest = params.guest?'&guest=1':''
    def buildId = System.getProperty('teamcity.agent.dotnet.build_id', null)
    if (env.BUILD_URL) {
        buildScan.link "TeamCity $version build", env.BUILD_URL
    } else if (params.baseUrl && buildId) {
        buildScan.link "TeamCity $version build", "${params.baseUrl}/viewLog.html?buildId=$buildId$guest"
    }
    buildScan.value "Teamcity $version build name", env.TEAMCITY_BUILDCONF_NAME

}


Update TeamCity recipe to recognize more cases
Update TeamCity recipe to recognize more cases
