diff --git a/lib/slather/coverage_service/coveralls.rb b/lib/slather/coverage_service/coveralls.rb index 8b6ed3f2..23c3fd32 100644 --- a/lib/slather/coverage_service/coveralls.rb +++ b/lib/slather/coverage_service/coveralls.rb @@ -31,6 +31,11 @@ def jenkins_job_id end private :jenkins_job_id + def teamcity_job_id + ENV['TC_BUILD_NUMBER'] + end + private :teamcity_job_id + def jenkins_branch_name branch_name = ENV['GIT_BRANCH'] if branch_name.include? 'origin/' @@ -161,6 +166,17 @@ def coveralls_coverage_data else raise StandardError, "Environment variable `BUILDKITE_BUILD_NUMBER` not set. Is this running on a buildkite build?" end + elsif ci_service == :teamcity + if teamcity_job_id + { + :service_job_id => teamcity_job_id, + :service_name => "teamcity", + :repo_token => coverage_access_token, + :source_files => coverage_files.map(&:as_json) + }.to_json + else + raise StandardError, "Environment variable `TC_BUILD_NUMBER` not set. Is this running on a teamcity agent?" + end else raise StandardError, "No support for ci named #{ci_service}" end