capistrano-graphite 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 051ad8bf4717e2359b76de74181695f939cf05c1
4
+ data.tar.gz: b878676c92b8c07bfbec37bc544858f830722dd9
5
+ SHA512:
6
+ metadata.gz: 91c3e0463963a6d1c052416984aea80904cbfd6a86eafaf4e1a2b26264493bce3a314c7d9cd5dbe8846127e2335137ea27e0948b3d79f079c5cfa865a1206867
7
+ data.tar.gz: e38bac35d67a2ec2c00561bcd77c3ca3d3024aefa8532413c59708701469144ebd5fe6dc7dc81e038030f98a740d7d5de437dee36b44d6cb393f80b5217fd977
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-graphite.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 scottsuch
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Capistrano::Graphite
2
+ [![Code Climate](https://codeclimate.com/github/scottsuch/capistrano-graphite.png)](https://codeclimate.com/github/scottsuch/capistrano-graphite)
3
+ This gem extends capistrano's deploy functionality by pushing events to graphite
4
+ Some information on events can be found in [this nice writeup](http://obfuscurity.com/2014/01/Graphite-Tip-A-Better-Way-to-Store-Events).
5
+ This gem works with capistrano v3.1.0 and above.
6
+ For a gem that works with older versions of capistrano go [here](https://github.com/hellvinz/graphite-notify).
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ gem 'capistrano-graphite'
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install capistrano-graphite
21
+
22
+ ## Usage
23
+
24
+ Require in ```Capfile``` to use the default task:
25
+
26
+ require "capistrano/graphite"
27
+
28
+ Configurable options:
29
+
30
+ set :graphite_url, "http://example.com:8000/events/"
31
+
32
+ ## Contributing
33
+
34
+ 1. Fork it ( https://github.com/[my-github-username]/capistrano-graphite/fork )
35
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
36
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
37
+ 4. Push to the branch (`git push origin my-new-feature`)
38
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/graphite/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-graphite"
8
+ spec.version = Capistrano::Graphite::VERSION
9
+ spec.authors = ["scottsuch"]
10
+ spec.email = ["sgorsuch@gmail.com"]
11
+ spec.summary = %q{Send deploy events to graphite via capistrano}
12
+ spec.description = %q{This gem plugs into the deploy task in capistrano to
13
+ help provide visibility to when deployments were
14
+ deploy.}
15
+ spec.homepage = "https://github.com/scottsuch/capistrano-graphite"
16
+ spec.license = "MIT"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", "~> 10.3"
25
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Graphite
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,27 @@
1
+ require 'capistrano'
2
+ require 'net/http'
3
+ require 'uri'
4
+
5
+ set :local_user, ENV['USER']
6
+
7
+ namespace :deploy do
8
+ desc 'notify graphite that a deployment occured'
9
+ task :graphite_deploy do
10
+ uri = URI::parse("#{fetch(:graphite_url)}")
11
+ Net::HTTP.start(uri.host, uri.port) do |http|
12
+ http.post(uri.path, "{\"what\": \"deploy #{fetch(:application)} in #{fetch(:stage)}\", \"tags\": \"#{fetch(:application)},#{fetch(:stage)},#{release_timestamp},deploy\", \"data\": \"#{fetch(:local_user)}\"}")
13
+ end
14
+ end
15
+
16
+ desc 'notify graphite that a rollback occured'
17
+ task :graphite_rollback do
18
+ uri = URI::parse("#{fetch(:graphite_url)}")
19
+ Net::HTTP.start(uri.host, uri.port) do |http|
20
+ http.post(uri.path, "{\"what\": \"rollback #{fetch(:application)} in #{fetch(:stage)}\", \"tags\": \"#{fetch(:application)},#{fetch(:stage)},#{release_timestamp},rollback\", \"data\": \"#{fetch(:local_user)}\"}")
21
+ end
22
+ end
23
+
24
+ # Set the order for these tasks
25
+ after 'deploy:updated', 'deploy:graphite_deploy'
26
+ after 'deploy:reverted', 'deploy:graphite_rollback'
27
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-graphite
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - scottsuch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.3'
41
+ description: |-
42
+ This gem plugs into the deploy task in capistrano to
43
+ help provide visibility to when deployments were
44
+ deploy.
45
+ email:
46
+ - sgorsuch@gmail.com
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".gitignore"
52
+ - Gemfile
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - capistrano-graphite.gemspec
57
+ - lib/capistrano/graphite.rb
58
+ - lib/capistrano/graphite/version.rb
59
+ homepage: https://github.com/scottsuch/capistrano-graphite
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.2.2
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Send deploy events to graphite via capistrano
83
+ test_files: []
84
+ has_rdoc: