Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added --sha parameter for non-Travis compatibility #36

Merged
merged 1 commit into from
Nov 26, 2015

Conversation

nickmerwin
Copy link
Contributor

When debugging an issue with @dokie I noticed that none of his builds were coming through from CircleCi with a commit SHA. When sending coverage data to Coveralls from Travis it's ok to omit that because we query their API to pull the commit info. But for other CI's it needs to be specified explicitly.

I've added SHA as the -s parameter here, but this could be refactored to pull git info directly from the environment. Here's how we do that in coveralls-ruby:

hash[:head] = {
  :id => ENV.fetch("GIT_ID", `git log -1 --pretty=format:'%H'`),
  :author_name => ENV.fetch("GIT_AUTHOR_NAME", `git log -1 --pretty=format:'%aN'`),
  :author_email => ENV.fetch("GIT_AUTHOR_EMAIL", `git log -1 --pretty=format:'%ae'`),
  :committer_name => ENV.fetch("GIT_COMMITTER_NAME", `git log -1 --pretty=format:'%cN'`),
  :committer_email => ENV.fetch("GIT_COMMITTER_EMAIL", `git log -1 --pretty=format:'%ce'`),
  :message => ENV.fetch("GIT_MESSAGE", `git log -1 --pretty=format:'%s'`)
}

hash[:branch] = ENV.fetch("GIT_BRANCH", `git rev-parse --abbrev-ref HEAD`)

Perhaps someone with more Elixir-foo could make that happen eventually.

Thanks!

parroty added a commit that referenced this pull request Nov 26, 2015
added --sha parameter for non-Travis compatibility
@parroty parroty merged commit ab0eaa1 into parroty:master Nov 26, 2015
@parroty
Copy link
Owner

parroty commented Nov 26, 2015

Thanks, I wasn't aware on this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants