simple_deploy 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35d6afc5913093b822e4f58784676020838d1489
4
- data.tar.gz: 3592e8cd7b9492323cdf32372474c3c5d01dde27
3
+ metadata.gz: 21a62f183767f5eb2b0ad15fc83f37d2235c6bd9
4
+ data.tar.gz: f3bb0ad9c9000997800defe4d829e516d0bb8602
5
5
  SHA512:
6
- metadata.gz: f4e27f8d4f7bdef7f4ea13b40ee9332d114c3e7be4635660f71995647e610c22aac75d90b776d906bcdffd476b91da455521a48a0c667c8028f6f8826d2d45b9
7
- data.tar.gz: f7402f08cf70a472daab185755d6c3289db11b89c0e941146c9528726116153911b7d151d9552ecca400bf4f4a9e16fd51545f75be458f644e8e7558c11ccdfd
6
+ metadata.gz: c150df5fcf0d5647122d2f96c93e67b19b2a10a2ebdfe073077c881a9d953adcb623399cf6c4282d034e01c52aae9852c1cb97d33f7cc12a906ba98c99ce2a1c
7
+ data.tar.gz: 626238b4b49ccaeeabb5d49888d2988b9efd94947c6c8deb5d3dba93c2ace20b136d325060356f5dd6ccbd0ef12078814880435846f9a1c3dfdbc5fdbf1e7d7e
@@ -1,5 +1,8 @@
1
1
  ## HEAD
2
2
 
3
+ ## v0.10.2 (05/07/15)
4
+ * Add support for sending notifications to Slack
5
+
3
6
  ## v0.10.0 (08/27/14):
4
7
 
5
8
  * Add support for setting configuration through env vars
@@ -1,4 +1,5 @@
1
1
  require 'simple_deploy/notifier/campfire'
2
+ require 'simple_deploy/notifier/slack'
2
3
 
3
4
  module SimpleDeploy
4
5
  class Notifier
@@ -36,6 +37,9 @@ module SimpleDeploy
36
37
  campfire = Notifier::Campfire.new :stack_name => @stack_name,
37
38
  :environment => @environment
38
39
  campfire.send message
40
+ when 'slack'
41
+ slack = Notifier::Slack.new
42
+ slack.send message
39
43
  end
40
44
  end
41
45
  end
@@ -0,0 +1,20 @@
1
+ require 'slack-notifier'
2
+
3
+ module SimpleDeploy
4
+ class Notifier
5
+ class Slack
6
+
7
+ def initialize(args = {})
8
+ @logger = SimpleDeploy.logger
9
+ @notifier = ::Slack::Notifier.new SimpleDeploy.config.notifications['slack']['webhook_url']
10
+ end
11
+
12
+ def send(message)
13
+ @logger.info "Sending Slack notification."
14
+ @notifier.ping message
15
+ @logger.info "Slack notification complete."
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module SimpleDeploy
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
@@ -29,4 +29,5 @@ Gem::Specification.new do |s|
29
29
  s.add_runtime_dependency "trollop", "= 2.0"
30
30
  s.add_runtime_dependency "fog", "= 1.23.0"
31
31
  s.add_runtime_dependency "retries", "= 0.0.5"
32
+ s.add_runtime_dependency "slack-notifier", "= 1.2.0"
32
33
  end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe SimpleDeploy::Notifier::Slack do
4
+ include_context 'stubbed config'
5
+ include_context 'double stubbed logger'
6
+
7
+ before do
8
+ @notifier = double('slack notifier')
9
+ ::Slack::Notifier.stub(:new => @notifier)
10
+ @config_mock.stub(:notifications => { 'slack' => { 'webhook_url' => 'url' } })
11
+ @slack = SimpleDeploy::Notifier::Slack.new
12
+ end
13
+
14
+ it 'should send a message to slack' do
15
+ @notifier.should_receive(:ping).with('message')
16
+ @slack.send('message')
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Weaver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-23 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fakefs
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.0.5
153
+ - !ruby/object:Gem::Dependency
154
+ name: slack-notifier
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '='
158
+ - !ruby/object:Gem::Version
159
+ version: 1.2.0
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '='
165
+ - !ruby/object:Gem::Version
166
+ version: 1.2.0
153
167
  description: Opinionated gem for Managing AWS Cloud Formation stacks and deploying
154
168
  updates to Instances.
155
169
  email:
@@ -207,6 +221,7 @@ files:
207
221
  - lib/simple_deploy/misc/attribute_merger.rb
208
222
  - lib/simple_deploy/notifier.rb
209
223
  - lib/simple_deploy/notifier/campfire.rb
224
+ - lib/simple_deploy/notifier/slack.rb
210
225
  - lib/simple_deploy/stack.rb
211
226
  - lib/simple_deploy/stack/deployment.rb
212
227
  - lib/simple_deploy/stack/deployment/status.rb
@@ -250,6 +265,7 @@ files:
250
265
  - spec/logger_spec.rb
251
266
  - spec/misc/attribute_merger_spec.rb
252
267
  - spec/notifier/campfire_spec.rb
268
+ - spec/notifier/slack_spec.rb
253
269
  - spec/notifier_spec.rb
254
270
  - spec/spec_helper.rb
255
271
  - spec/stack/deployment/status_spec.rb
@@ -317,6 +333,7 @@ test_files:
317
333
  - spec/logger_spec.rb
318
334
  - spec/misc/attribute_merger_spec.rb
319
335
  - spec/notifier/campfire_spec.rb
336
+ - spec/notifier/slack_spec.rb
320
337
  - spec/notifier_spec.rb
321
338
  - spec/spec_helper.rb
322
339
  - spec/stack/deployment/status_spec.rb