Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Support for Capistrano deploy annotations #41

Closed
cmer opened this issue Jan 13, 2013 · 9 comments
Closed

Support for Capistrano deploy annotations #41

cmer opened this issue Jan 13, 2013 · 9 comments

Comments

@cmer
Copy link

cmer commented Jan 13, 2013

Would be great if you provided Capistrano hooks to automatically annotate our metrics on deploy (tagged with Git commit id, who deployed, which branch and which stage)

@nextmat
Copy link
Contributor

nextmat commented Jan 13, 2013

Good idea, we'll take a look at adding this.

@teamon
Copy link

teamon commented Apr 12, 2013

Any progress?

@teamon
Copy link

teamon commented Apr 12, 2013

I made something like this for myself and put this in lib/tasks/librato.rake.

namespace :librato do
  task :deploy => :environment do
    sha, msg = `git show --pretty="%h:%s"`.strip.split(":", 2)

    Librato::Rails.client.annotate :deployments, "Deployed #{sha}",
      :description => msg,
      :source => Librato::Rails.source,
      :links => [
        {:rel => "github", :href => "http://github.com/user/repo/commit/#{sha}"}
      ]
  end
end

@nextmat
Copy link
Contributor

nextmat commented Apr 14, 2013

Awesome, thanks! I'd like to implement a stand-alone cap plugin so people don't have to be married to any of our specific libs for easy annotation support but this is an awesome example of how to get it up quick now. Thanks very much for taking the time to share this.

@teamon
Copy link

teamon commented Apr 14, 2013

Do not bother with cap, it is too specific and too simple. Simple rake task will do.

after :"deploy:symlink", :"librato:deploy";

namespace :librato do
  desc "Annotate librato deploy"
  task :deploy do
    run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake librato:deploy"
  end
end

@OleMchls
Copy link

I've written a 'standalone' gem you might be interested in: https://github.com/Jimdo/librato-rake-deploytrack

@nextmat
Copy link
Contributor

nextmat commented Jul 30, 2014

@Nesquick Awesome, I'll add reference to that in the README.

@nextmat
Copy link
Contributor

nextmat commented Jul 30, 2014

Added here: https://github.com/librato/librato-rails#tracking-deploys

Going to go ahead and close this since both this ticket and the gem are now referenced in the README.

@nextmat nextmat closed this as completed Jul 30, 2014
@OleMchls
Copy link

❤️

On Wednesday, July 30, 2014, Matt Sanders notifications@github.com wrote:

Closed #41 #41.


Reply to this email directly or view it on GitHub
#41 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants