Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
add teamcity as an ci server option
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrlesch committed Feb 2, 2016
1 parent 9be196a commit 4a101fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/slather/coverage_service/coveralls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a101fd

Please sign in to comment.