Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2010 21:01
Show Gist options
  • Save anonymous/442772 to your computer and use it in GitHub Desktop.
Save anonymous/442772 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'rubygems'
require 'codefumes_harvester'
def ant_success?
ENV['ANT_RET'] == '0'
end
pub_key = ENV['CF_PUBLIC_KEY']
priv_key = ENV['CF_PRIVATE_KEY']
commit_id = `git log | awk 'NR==1 { print $2 }'`.chomp
if ARGV[0] == "start"
`/var/lib/gems/1.8/bin/cf_harvest_repo_metrics`
sc = CodeFumesHarvester::SourceControl.new('.')
CodeFumesHarvester::QuickBuild.start("ant", :commit_identifier => commit_id, :private_key => sc.private_key)
elsif ARGV[0] == "end"
if ant_success?
status = "successful"
else
status = "failed"
end
CodeFumesHarvester::QuickBuild.finish("ant", status, :commit_identifier => commit_id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment