Skip to content

Instantly share code, notes, and snippets.

@timruffles
Created November 2, 2010 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timruffles/659581 to your computer and use it in GitHub Desktop.
Save timruffles/659581 to your computer and use it in GitHub Desktop.
Makes commit hashes and pivotal ids clickable - only need to pull in project github url
# cruisecontrol/app/views/build_mailer/build_report.html.erb
<% if Configuration.dashboard_url -%>
<%= @message %>
CHANGES
-------
<%
require 'uri'
repos = URI.parse(@build.project.source_control.repository)
for_viewing_url = "https://#{repos.host}#{repos.path.gsub(/\.git\/?$/,'')}"
%>
<%= @build.changeset.gsub(/([a-f0-9]{40})/,for_viewing_url + '/commit/\1">\1</a>').gsub(/\[([^\]]*)#(\d+)([^\]]*)\]/,'<a href="https://www.pivotaltracker.com/projects/85567?story_id=\2">[\1#\2\3]</a>') %>
<% unless @failures_and_errors.empty? -%>
TEST FAILURES AND ERRORS
-----------------------
<%= @failures_and_errors %>
<% end -%>
See <%= "#{@build.url}" %> for details.
<% else -%>
<%= @message %>
Note: if you set Configuration.dashboard_url in config/site_config.rb, you'd see a link to the build page here.
CHANGES
-------
<%= @build.changeset %>
BUILD LOG
---------
<%= @build.output %>
PROJECT SETTINGS
----------------
<%= @build.project_settings %>
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment