Skip to content

Instantly share code, notes, and snippets.

@JoeStanton
Created November 4, 2013 15:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 'joe.stanton@red-badger.com', '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