paratrooper-newrelic 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of paratrooper-newrelic might be problematic. Click here for more details.

@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDhmMGViNzg3Y2JkNTliMGVmNjdhYWYxNjk5M2RiZTNhNDIxZDYxMQ==
5
+ data.tar.gz: !binary |-
6
+ YTRjNzg2NjgzZTVhNGJhMjgwMTlhM2E0YzZkN2ZlYTAxYmU2NTU3MA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NjRmZTIwNGExZDJkNDM5NjExNTQ2MWRkNGVjZDc1ZGQxZDFiYTYxYmMzNjVl
10
+ ZjNkMzA4YjBlODkzYTg5MzVmMmNiZGU2NDU3OGQzNTczNGNiOGMxODk2MDk5
11
+ NDgxZDY2MmRiMTVlZTc0NjQxZWVjNzY0MzA5Y2I5YjBmNmViNDQ=
12
+ data.tar.gz: !binary |-
13
+ ZmJkZDJlZmE0MGE3MWRlMzZiNTE3Mjc0NzZmNjRmZGQ5NjZiMzYyZTEyNmIx
14
+ YmIyODFhNzk2Nzg0NWJlNzAyOTM2NGVkOTA3MDhlOTAyNzdkODRjNWMzNTMz
15
+ NDNmMDQ4MmYzNGJiNDNkMDZlZjA4ZjBlY2RmNzFhMDI4NmE1ODM=
@@ -0,0 +1,17 @@
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
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in paratrooper-airbrake.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Matt Polito
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.
@@ -0,0 +1,52 @@
1
+ # Paratrooper - Newrelic Notifier
2
+
3
+ Notify [Newrelic][] to stop application monitoring during deployments when
4
+ using [Paratrooper][]
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'paratrooper-newrelic'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install paratrooper-newrelic
19
+
20
+ ## Usage
21
+
22
+ When initializing `Paratrooper::Deploy` a `notifiers` option can be passed
23
+
24
+ ```ruby
25
+ Paratrooper::Deploy.new('app_name',
26
+ notifiers: [
27
+ Paratrooper::Newrelic::Notifier.new('api_key', 'account_id', 'application_id')
28
+ ]
29
+ )
30
+ ```
31
+
32
+ This will notify Newrelic that a deploy has begun and to stop application
33
+ monitoring until enabled again. When Paratrooper has finished your deploy
34
+ another notification will be sent to Newrelic to enable application monitoring.
35
+
36
+ For more information on `notifiers`, see [Paratrooper][] documentation.
37
+
38
+ ## Contributing
39
+
40
+ 1. Fork it
41
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
42
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
43
+ 4. Push to the branch (`git push origin my-new-feature`)
44
+ 5. Create new Pull Request
45
+
46
+ ## Thanks
47
+
48
+ * [Brandon Farmer][]
49
+
50
+ [Newrelic]: http://newrelic.com
51
+ [Paratrooper]: https://github.com/mattpolito/paratrooper
52
+ [Brandon Farmer]: https://github.com/bthesorceror
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,33 @@
1
+ require "paratrooper-newrelic/version"
2
+ require 'paratrooper/notifier'
3
+
4
+ module Paratrooper
5
+ module Newrelic
6
+
7
+ # Public: Sends notification to NewRelic to stop monitoring while deploy is
8
+ # happening
9
+ #
10
+ class Notifier < Paratrooper::Notifier
11
+ attr_reader :account_id, :api_key, :application_id
12
+
13
+ # Public: Initializes NewRelicNotifier
14
+ #
15
+ # api_key - String api key from NewRelic
16
+ # account_id - String NewRelic account id
17
+ # application_id - String NewRelic id of application
18
+ def initialize(api_key, account_id, application_id)
19
+ @api_key = api_key
20
+ @account_id = account_id
21
+ @application_id = application_id
22
+ end
23
+
24
+ def setup(options = {})
25
+ %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/disable -X POST -H "X-Api-Key: #{api_key}"]
26
+ end
27
+
28
+ def teardown(options = {})
29
+ %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/enable -X POST -H "X-Api-Key: #{api_key}"]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ module Paratrooper
2
+ module Newrelic
3
+ VERSION = "1.0.1"
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'paratrooper-newrelic/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "paratrooper-newrelic"
8
+ gem.version = Paratrooper::Newrelic::VERSION
9
+ gem.authors = ["Brandon Farmer", "Matt Polito"]
10
+ gem.email = ["bthesorceror@gmail.com", "matt.polito@gmail.com"]
11
+ gem.description = %q{Send deploy notifications to Newrelic service when deploying with Paratrooper}
12
+ gem.summary = %q{Send deploy notifications to Newrelic service when deploying with Paratrooper}
13
+ gem.homepage = "http://github.com/mattpolito/paratrooper-newrelic"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_development_dependency 'rake'
21
+ gem.add_development_dependency 'rspec', '~> 2.12'
22
+ gem.add_development_dependency 'pry'
23
+ gem.add_dependency 'paratrooper', '~> 1.2'
24
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: paratrooper-newrelic
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brandon Farmer
8
+ - Matt Polito
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rspec
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '2.12'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: '2.12'
42
+ - !ruby/object:Gem::Dependency
43
+ name: pry
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: paratrooper
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '1.2'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '1.2'
70
+ description: Send deploy notifications to Newrelic service when deploying with Paratrooper
71
+ email:
72
+ - bthesorceror@gmail.com
73
+ - matt.polito@gmail.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - .gitignore
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - lib/paratrooper-newrelic.rb
84
+ - lib/paratrooper-newrelic/version.rb
85
+ - paratrooper-newrelic.gemspec
86
+ homepage: http://github.com/mattpolito/paratrooper-newrelic
87
+ licenses: []
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.0.3
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Send deploy notifications to Newrelic service when deploying with Paratrooper
109
+ test_files: []
110
+ has_rdoc: