capistrano-slack-notify 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/slack_notify.rb +12 -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: dcd05a29bff6366c6eba507d2c491df5809ea39c
|
4
|
+
data.tar.gz: 62fbc194ae3fc389203a451f7427975a89f6b9b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ce6698903ff89f0a9f2602304a6454a74409ebd0da2c3fa4b8978f8038462e4bfbb28c2404d37dacb0246fb5f90354104cbe5b54b3e17aa375f7fcfe4475bb7
|
7
|
+
data.tar.gz: 7cb96ebc8c94152c0618c81871b9554a2eba9ffff6661471de1b28fba0e9ecd35ec0b6779d1e7babe0e852e9f71150f8a7da81e45c59ac1c41bc4ce3fd8be5fe
|
@@ -17,10 +17,6 @@ module Capistrano
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def slack_defaults
|
20
|
-
if fetch(:slack_deploy_defaults, true)
|
21
|
-
before 'deploy', 'slack:starting'
|
22
|
-
after 'deploy', 'slack:finished'
|
23
|
-
end
|
24
20
|
end
|
25
21
|
|
26
22
|
def payload(announcement)
|
@@ -36,9 +32,17 @@ module Capistrano
|
|
36
32
|
fetch(:slack_webhook_url)
|
37
33
|
end
|
38
34
|
|
35
|
+
def slack_app_name
|
36
|
+
fetch(:slack_app_name, fetch(:application))
|
37
|
+
end
|
38
|
+
|
39
39
|
def self.extended(configuration)
|
40
40
|
configuration.load do
|
41
|
-
|
41
|
+
# Add the default hooks by default.
|
42
|
+
if fetch(:slack_deploy_defaults, true)
|
43
|
+
before 'deploy', 'slack:starting'
|
44
|
+
after 'deploy', 'slack:finished'
|
45
|
+
end
|
42
46
|
|
43
47
|
set :deployer do
|
44
48
|
ENV['USER'] || ENV['GIT_AUTHOR_NAME'] || `git config user.name`.chomp
|
@@ -48,9 +52,9 @@ module Capistrano
|
|
48
52
|
desc "Notify Slack that the deploy has started."
|
49
53
|
task :starting do
|
50
54
|
msg = if branch = fetch(:branch, nil)
|
51
|
-
"#{fetch(:deployer)} is deploying #{
|
55
|
+
"#{fetch(:deployer)} is deploying #{slack_app_name}/#{branch} to #{fetch(:stage, 'production')}"
|
52
56
|
else
|
53
|
-
"#{fetch(:deployer)} is deploying #{
|
57
|
+
"#{fetch(:deployer)} is deploying #{slack_app_name} to #{fetch(:stage, 'production')}"
|
54
58
|
end
|
55
59
|
call_slack_api(msg)
|
56
60
|
set(:start_time, Time.now)
|
@@ -58,7 +62,7 @@ module Capistrano
|
|
58
62
|
|
59
63
|
desc "Notify Slack that the deploy has completed successfully."
|
60
64
|
task :finished do
|
61
|
-
msg = "#{fetch(:deployer)} deployed to #{
|
65
|
+
msg = "#{fetch(:deployer)} deployed to #{slack_app_name} successfully"
|
62
66
|
if start_time = fetch(:start_time, nil)
|
63
67
|
elapsed = Time.now.to_i - start_time.to_i
|
64
68
|
msg << " in #{elapsed} seconds."
|
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.1.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-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|