Project

buildhawk

0.0
No commit activity in last 3 years
No release in over 3 years
Display historical stats about your build
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Buildhawk¶ ↑

Historical information about your build, on a webpage! Currently only graphs time taken, as stored in git notes.

See how it looks: rhnh.net/2010/09/18/build-time-graph-with-buildhawk

Status¶ ↑

Pretty raw: hackish script, no error checking, no test suite. I am adding to it as I use on one of my projects. Only checked on ruby 1.9.2. Depends on an unreleased experimental branch of TufteGraph (github.com/xaviershay/tufte-graph/tree/line).

Usage¶ ↑

gem install buildhawk

buildhawk --title "My App Name" # In your project directory, output HTML to stdout
buildhawk | browser             # Using http://gist.github.com/318247

You need to store the build time in git notes. This should be a single float: the build time in seconds. The following rake task should work for a standard ruby project with rvm. See rhnh.net/2010/09/06/storing-build-time-in-git-notes-with-zsh for more explanation. Note that ‘time` does not appear to output consistent enough spacing to be used reliably with cut, you may need to tweak the `cut -f 11 -d` command to pull out the right field.

namespace :build do
  desc "Run specs and store the time taken in a git note on HEAD"
  task :time do
    # ruby/rake are not aliased by rvm in the new zsh environment, so
    # have to explicitly call it using the rvm command stored in .rvmrc:
    #   rvm 1.9.2@myapp rake
    #
    # "2> >( )" construct redirects STDERR (where @time@ prints to) to the
    # bracketed commands. ZSH allows us to redirect it twice, once to git,
    # once to cat (back to STDOUT).
    formatter = "tail -n 1 | cut -f 11 -d ' ' - "
    exec((%{zsh -c "(time `cat .rvmrc` rake) } + 
          %{2> >(#{formatter} | git notes --ref=buildtime add -F - -f ) } +
          %{2> >(#{formatter} | cat)"}))
  end
end