paratrooper 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTNkMmU3MDBhNmJmMDNhOTQ5MDEyOTFlMjFlMzkzM2E4ZjYzYzlhZQ==
5
+ data.tar.gz: !binary |-
6
+ NmQzYmEwYTNmYTQ0YjQwMTFkMWE3MjI0ZThhZGNmODZhYWM1OGI4ZA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Njg3ZDg5YmNjZTcxYTc2YTVlNGIwZThlNjg2NTAxYTZhMjRkOTVhZGY4NWZi
10
+ ODRkNjJiOTJiOGJhYmZkYTQ2MDE4ODNjYmIwYTEyNGFhOGM5NWU5OGY0NjY5
11
+ NzdjYTBhY2RjNzRlZDkxOGUyZjNhNWExNWNhN2VhOGM4MTlkNTE=
12
+ data.tar.gz: !binary |-
13
+ MzhjZTAyMzkyYTFhNjU5YTkzZmI3YWY1YzkzZGUwYjBjMWM3NTdjMTI4NzU2
14
+ YTgyNzYwNGJmZDVjNTk2YjAyNmNjNjYxZWQxY2VkNzY1MDI0ZDgwY2IwNzcw
15
+ MmU5MTRhZDdiMjI5MjRiYzY4YWZhYzM4MDU3Y2RjNzVhZTZhYmY=
data/README.md CHANGED
@@ -131,13 +131,20 @@ end
131
131
 
132
132
  ## Bucking the Norm
133
133
 
134
- Our default deploy gets us most of the way, but maybe it's not for you. We've got you covered. Every instance of Paratrooper will have access to all of the included methods so you can build your custom deploy.
134
+ Our default deploy gets us most of the way, but maybe it's not for you. We've
135
+ got you covered. Every deployment method sends a notification that can be
136
+ captured and used in most any way you can think of.
135
137
 
136
- For example, say you want to let [New Relic][] know that you are deploying and to disable your heartbeart.
138
+ For example, say you want to let [New Relic][] know that you are deploying and
139
+ to disable your application monitoring.
137
140
 
138
141
  ### Example Usage
139
142
 
140
143
  ```ruby
144
+ # Gemfile
145
+ gem 'paratrooper-newrelic'
146
+
147
+ # lib/tasks/deploy.rake
141
148
  require 'paratrooper'
142
149
 
143
150
  namespace :deploy do
@@ -145,27 +152,22 @@ namespace :deploy do
145
152
  task :production do
146
153
  deployment = Paratrooper::Deploy.new("amazing-production-app",
147
154
  tag: 'production',
148
- match_tag_to: 'staging'
155
+ match_tag_to: 'staging',
156
+ notifiers: [
157
+ Paratrooper::Notifers::ScreenNotifier.new,
158
+ Paratrooper::Newrelic::Notifier.new('api_key', 'account_id', 'application_id')
159
+ ]
149
160
  )
150
-
151
- %x[curl https://heroku.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/disable -X POST -H "X-Api-Key: API_KEY"]
152
-
153
- deployment.activate_maintenance_mode
154
- deployment.update_repo_tag
155
- deployment.push_repo
156
- deployment.run_migrations
157
- deployment.app_restart
158
- deployment.deactivate_maintenance_mode
159
- deployment.warm_instance
160
-
161
- %x[curl https://heroku.newrelic.com/accounts/ACCOUNT_ID/applications/APPLICATION_ID/ping_targets/enable -X POST -H "X-Api-Key: API_KEY"]
162
161
  end
163
162
  end
164
163
  ```
165
164
 
166
- ## Nice to haves
165
+ * The `ScreenNotifier` is added by default so when you override the `notifiers`
166
+ option you need to manually add it in to continue getting screen output.
167
+
168
+ To make your own notifier, take a look at [`Paratrooper::Notifier`][] to see
169
+ what methods are available to be overridden.
167
170
 
168
- * Send [New Relic][] a notification to toggle heartbeat during deploy
169
171
 
170
172
  ## Contributing
171
173
 
@@ -183,3 +185,4 @@ end
183
185
  [Heroku Toolbelt]: http://toolbelt.heroku.com
184
186
  [New Relic]: http://newrelic.com
185
187
  [Rye Mason]: https://github.com/ryenotbread
188
+ [`Paratrooper::Notifier`]: https://github.com/mattpolito/paratrooper/blob/master/lib/paratrooper/notifier.rb
@@ -1,9 +1,19 @@
1
1
  module Paratrooper
2
+
3
+ # Public: Shell object with methods to be overridden by other notifiers
4
+ #
5
+ # All notifiers should inherit from this class
6
+ #
2
7
  class Notifier
3
8
  def notify(step_name, options = {})
4
9
  self.send(step_name, options)
5
10
  end
6
11
 
12
+ #
13
+ # To create your own notifier override the following methods.
14
+ #
15
+
16
+ def setup(options = {}); end
7
17
  def activate_maintenance_mode(options = {}); end
8
18
  def deactivate_maintenance_mode(options = {}); end
9
19
  def update_repo_tag(options = {}); end
@@ -11,7 +21,6 @@ module Paratrooper
11
21
  def run_migrations(options = {}); end
12
22
  def app_restart(options = {}); end
13
23
  def warm_instance(options = {}); end
14
- def setup(options = {}); end
15
24
  def teardown(options = {}); end
16
25
  end
17
26
  end
@@ -1,3 +1,3 @@
1
1
  module Paratrooper
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paratrooper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Matt Polito
@@ -15,7 +14,6 @@ dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rake
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ! '>='
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ! '>='
29
26
  - !ruby/object:Gem::Version
@@ -31,7 +28,6 @@ dependencies:
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rspec
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
32
  - - ~>
37
33
  - !ruby/object:Gem::Version
@@ -39,7 +35,6 @@ dependencies:
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
39
  - - ~>
45
40
  - !ruby/object:Gem::Version
@@ -47,7 +42,6 @@ dependencies:
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: pry
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
46
  - - ! '>='
53
47
  - !ruby/object:Gem::Version
@@ -55,7 +49,6 @@ dependencies:
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
53
  - - ! '>='
61
54
  - !ruby/object:Gem::Version
@@ -63,7 +56,6 @@ dependencies:
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: heroku-api
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
60
  - - ~>
69
61
  - !ruby/object:Gem::Version
@@ -71,7 +63,6 @@ dependencies:
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
67
  - - ~>
77
68
  - !ruby/object:Gem::Version
@@ -79,7 +70,6 @@ dependencies:
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: netrc
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
74
  - - ~>
85
75
  - !ruby/object:Gem::Version
@@ -87,7 +77,6 @@ dependencies:
87
77
  type: :runtime
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
81
  - - ~>
93
82
  - !ruby/object:Gem::Version
@@ -111,8 +100,6 @@ files:
111
100
  - lib/paratrooper/heroku_wrapper.rb
112
101
  - lib/paratrooper/local_api_key_extractor.rb
113
102
  - lib/paratrooper/notifier.rb
114
- - lib/paratrooper/notifiers/airbrake_notifier.rb
115
- - lib/paratrooper/notifiers/new_relic_notifier.rb.rb
116
103
  - lib/paratrooper/notifiers/screen_notifier.rb
117
104
  - lib/paratrooper/system_caller.rb
118
105
  - lib/paratrooper/version.rb
@@ -126,27 +113,26 @@ files:
126
113
  - spec/spec_helper.rb
127
114
  homepage: http://github.com/mattpolito/paratrooper
128
115
  licenses: []
116
+ metadata: {}
129
117
  post_install_message:
130
118
  rdoc_options: []
131
119
  require_paths:
132
120
  - lib
133
121
  required_ruby_version: !ruby/object:Gem::Requirement
134
- none: false
135
122
  requirements:
136
123
  - - ! '>='
137
124
  - !ruby/object:Gem::Version
138
125
  version: '0'
139
126
  required_rubygems_version: !ruby/object:Gem::Requirement
140
- none: false
141
127
  requirements:
142
128
  - - ! '>='
143
129
  - !ruby/object:Gem::Version
144
130
  version: '0'
145
131
  requirements: []
146
132
  rubyforge_project:
147
- rubygems_version: 1.8.24
133
+ rubygems_version: 2.0.3
148
134
  signing_key:
149
- specification_version: 3
135
+ specification_version: 4
150
136
  summary: Library to create task for deployment to Heroku
151
137
  test_files:
152
138
  - spec/fixtures/netrc
@@ -1,11 +0,0 @@
1
- require 'paratrooper/notifier'
2
-
3
- module Paratrooper
4
- module Notifiers
5
- class AirbrakeNotifier
6
- def setup
7
- `airbrake deploy`
8
- end
9
- end
10
- end
11
- end
@@ -1,32 +0,0 @@
1
- require 'paratrooper/notifier'
2
-
3
- module Paratrooper
4
- module Notifiers
5
-
6
- # Public: Sends notification to NewRelic to stop monitoring while deploy is
7
- # happening
8
- #
9
- class NewRelicNotifier < Notifier
10
- attr_reader :account_id, :api_key, :application_id
11
-
12
- # Public: Initializes NewRelicNotifier
13
- #
14
- # api_key - String api key from NewRelic
15
- # account_id - String NewRelic account id
16
- # application_id - String NewRelic id of application
17
- def initialize(api_key, account_id, application_id)
18
- @api_key = api_key
19
- @account_id = account_id
20
- @application_id = application_id
21
- end
22
-
23
- def setup
24
- %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/disable -X POST -H "X-Api-Key: #{api_key}"]
25
- end
26
-
27
- def teardown
28
- %x[curl https://heroku.newrelic.com/accounts/#{account_id}/applications/#{application_id}/ping_targets/enable -X POST -H "X-Api-Key: #{api_key}"]
29
- end
30
- end
31
- end
32
- end