capistrano-slack-notify 1.2.0 → 1.3.0

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: 597babae6822e2dffabad72f6607efe7b008718e
4
- data.tar.gz: 5b89b96750008e0fc649c748f109285a82762c67
3
+ metadata.gz: 3168ae89526cb1157bc708478c4f99151bd86a0e
4
+ data.tar.gz: 83104a8b27ee3fbeb0f2630924b25751c53cf063
5
5
  SHA512:
6
- metadata.gz: 5ab71fcc8597b01deff8578c7733e5b3d1514ea8f40bd21d9d38bf8753137c7ef790bb8a0935ad637f03aee91695fbfa0f2c8c6b5568f9e52a154fb3e3d8380a
7
- data.tar.gz: b8cfc1bdc15e1cd897a1ee276283065780c6a244ec18312c54a7160cac5ecf525c3c55a75ef2df2ef5a86e73afc00ef54e9b04ff46d313d45d57d2d21dd52ca2
6
+ metadata.gz: 3d072178433a6b78da7b4884d7a84e15b1d61beab9bd11b16233c2e3b7aff5507c26eda103b8d500ed7fff4319e4832327668ae0e4c39b2feb636b038e91776a
7
+ data.tar.gz: cd901f8a41d94d78aa20610ce274dab9a2ce203272b3e98fb971c9a3ce93d0093d9e70eecc6f4278d09f317b26182e70e33488500fad012435ff869e56d03f57
@@ -86,15 +86,16 @@ module Capistrano
86
86
  fetch(:stage, 'production')
87
87
  end
88
88
 
89
+ def destination
90
+ fetch(:slack_destination, stage)
91
+ end
92
+
89
93
  def revision
90
- `git rev-parse #{branch}`.chomp
94
+ @revision ||= `git rev-parse #{branch}`.chomp
91
95
  end
92
96
 
93
97
  def deploy_target
94
- [
95
- slack_app_name,
96
- branch
97
- ].join('/') + " (#{revision[0..5]})"
98
+ [slack_app_name, branch].join('/') + (revision ? " (#{revision[0..5]})" : "")
98
99
  end
99
100
 
100
101
  def self.extended(configuration)
@@ -107,13 +108,13 @@ module Capistrano
107
108
  namespace :slack do
108
109
  desc "Notify Slack that the deploy has started."
109
110
  task :starting do
110
- post_to_channel(:grey, "#{deployer} is deploying #{deploy_target} to #{stage}")
111
+ post_to_channel(:grey, "#{deployer} is deploying #{deploy_target} to #{destination}")
111
112
  set(:start_time, Time.now)
112
113
  end
113
114
 
114
115
  desc "Notify Slack that the deploy has completed successfully."
115
116
  task :finished do
116
- msg = "#{deployer} deployed #{deploy_target} to #{stage} *successfully*"
117
+ msg = "#{deployer} deployed #{deploy_target} to #{destination} *successfully*"
117
118
 
118
119
  if start_time = fetch(:start_time, nil)
119
120
  msg << " in #{Time.now.to_i - start_time.to_i} seconds."
@@ -126,7 +127,7 @@ module Capistrano
126
127
 
127
128
  desc "Notify Slack that the deploy failed."
128
129
  task :failed do
129
- post_to_channel(:red, "#{deployer} *failed* to deploy #{deploy_target} to #{stage}")
130
+ post_to_channel(:red, "#{deployer} *failed* to deploy #{deploy_target} to #{destination}")
130
131
  end
131
132
  end # end namespace :slack
132
133
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-slack-notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-27 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano