Skip to content

Instantly share code, notes, and snippets.

@JoeStanton
Created November 4, 2013 15:14
Show Gist options
  • Save JoeStanton/7303958 to your computer and use it in GitHub Desktop.
Save JoeStanton/7303958 to your computer and use it in GitHub Desktop.
Sample task that can be hooked into Capistrano for deploy-time annotations.
require 'librato/metrics'
REPO_NAME = 'JoeStanton/my-project'
Librato::Metrics.authenticate '[email protected]', 'API_KEY'
sha, msg = `git log -n 1 --pretty="%h:%s"`.strip.split(":", 2)
Librato::Metrics.annotate :deployments, "Deployed #{sha}", {
description: msg,
links: [ {rel: "github", href: "http://github.com/#{REPO_NAME}/commit/#{sha}"} ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment