slackistrano 0.0.7 → 0.0.8

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: 7350c269ff5c94d10f9f36fc076df3d75a04688b
4
- data.tar.gz: 63950460d7105f37f8fc03d71dc080eec681e22c
3
+ metadata.gz: 134770108f5954d02a69beaca6f9a875091d8944
4
+ data.tar.gz: 3f9c9ea0ff1f28bbd0dd426db8f4ce14035e2efb
5
5
  SHA512:
6
- metadata.gz: 4c24688ffa9f549a563d98557136c32897fe21f7c6d9fc50bdb3512322cef78001ab8d3b8fde251eee52f0e7f0b495d43b43b4b1fc8916221c30a84eadf37f79
7
- data.tar.gz: 57306c71a67d306b3a8876e749d18e7675edec79415bca26119fbc413b18897aca05a9f06511d24aa54cc235be0b0d423d2f0055474acc209fbd8d747f9eaf2f
6
+ metadata.gz: 964b1cb2f7fbc5225c0bbe34381d4492834aef92c32f156c7680c3d3519a5a7d5a7f82b3de018694f063f9c768721c71ab38fe8d3a1a8c74b489178674ced8e2
7
+ data.tar.gz: ba8e0f3bb612b073cb955ad63c8a83db217bc313d46eed8f2dcf8f44ad4d21afca761724c96913bb76620ac78e94abacece7df70214575b21249ebb58e52020c
data/README.md CHANGED
@@ -45,8 +45,10 @@ Optionally, override the other slack settings:
45
45
  set :slack_username, ->{ 'Slackistrano' }
46
46
  set :slack_run_starting, ->{ true }
47
47
  set :slack_run_finished, ->{ true }
48
+ set :slack_run_failed, ->{ true }
48
49
  set :slack_msg_starting, ->{ "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
49
50
  set :slack_msg_finished, ->{ "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
51
+ set :slack_msg_failed, ->{ "*ERROR!* #{ENV['USER'] || ENV['USERNAME']} failed to deploy branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
50
52
 
51
53
  **Note**: You may wish to disable one of the notifications if another service (ex:
52
54
  Honeybadger) also displays a deploy notification.
@@ -55,6 +57,7 @@ Test your setup by running:
55
57
 
56
58
  $ cap production slack:deploy:starting
57
59
  $ cap production slack:deploy:finished
60
+ $ cap production slack:deploy:failed
58
61
 
59
62
  ## Usage
60
63
 
@@ -35,11 +35,30 @@ namespace :slack do
35
35
  end
36
36
  end
37
37
  end
38
+
39
+ task :failed do
40
+ if fetch(:slack_run_failed)
41
+ run_locally do
42
+ Slackistrano.post(
43
+ team: fetch(:slack_team),
44
+ token: fetch(:slack_token),
45
+ payload: {
46
+ channel: fetch(:slack_channel),
47
+ username: fetch(:slack_username),
48
+ icon_url: fetch(:slack_icon_url),
49
+ text: fetch(:slack_msg_failed)
50
+ }
51
+ )
52
+ end
53
+ end
54
+ end
55
+
38
56
  end
39
57
  end
40
58
 
41
59
  before 'deploy:starting', 'slack:deploy:starting'
42
- after 'deploy:finished', 'slack:deploy:finished'
60
+ after 'deploy:finished', 'slack:deploy:finished'
61
+ after 'deploy:failed', 'slack:deploy:failed'
43
62
 
44
63
  namespace :load do
45
64
  task :defaults do
@@ -50,7 +69,9 @@ namespace :load do
50
69
  set :slack_username, ->{ 'Slackistrano' }
51
70
  set :slack_run_starting, ->{ true } # Set to false to disable starting message.
52
71
  set :slack_run_finished, ->{ true } # Set to false to disable finished message.
72
+ set :slack_run_failed, ->{ true } # Set to false to disable failure message.
53
73
  set :slack_msg_starting, ->{ "#{ENV['USER'] || ENV['USERNAME']} has started deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
54
74
  set :slack_msg_finished, ->{ "#{ENV['USER'] || ENV['USERNAME']} has finished deploying branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
75
+ set :slack_msg_failed, ->{ "*ERROR!* #{ENV['USER'] || ENV['USERNAME']} failed to deploy branch #{fetch :branch} of #{fetch :application} to #{fetch :rails_env, 'production'}." }
55
76
  end
56
77
  end
@@ -1,3 +1,3 @@
1
1
  module Slackistrano
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hallstrom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json