capistrano-slack-notify 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/capistrano/slack_notify.rb +9 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3168ae89526cb1157bc708478c4f99151bd86a0e
|
4
|
+
data.tar.gz: 83104a8b27ee3fbeb0f2630924b25751c53cf063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 #{
|
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 #{
|
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 #{
|
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.
|
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-
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|