capistrano-slack_notification 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/capistrano/slack_notification/version.rb +1 -1
- data/lib/capistrano/tasks/slack_notification.rake +34 -22
- data/misc/preview.png +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3751a9dbea2e8a4dc7f4aad0662930a71c50a1
|
4
|
+
data.tar.gz: 2a5eff99e99f41fd0ed59a793ed787be3ec5ac45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d8241e1d74a8a6c4e5715a344e4ba6c8ee1b6739d80912e30fe75fb0acc9ff4cecb408ddc0ef950c0cbdd540c90c8a436dd1abd3fb53e52cf275a5be84e69c5
|
7
|
+
data.tar.gz: 5614e1ddbf62d81c0a39ec31a93195fbcddf0cf2a5861ffa7e535bab92395f5fe7ca8b86068944e7be01e8c68a354e19ae69b7697160077eaaa90ed1d5b8e914
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@ Capistrano - Slack Notification
|
|
3
3
|
|
4
4
|
Notify Capistrano ver3 deployment to Slack.
|
5
5
|
|
6
|
+
![slack-notification-preview](https://raw.githubusercontent.com/linyows/capistrano-slack_notification/master/misc/preview.png)
|
7
|
+
|
6
8
|
[![Gem version](https://img.shields.io/gem/v/capistrano-slack_notification.svg?style=flat-square)][gem]
|
7
9
|
[gem]: https://rubygems.org/gems/capistrano-slack_notification
|
8
10
|
|
@@ -48,30 +48,38 @@ namespace :slack do
|
|
48
48
|
text = "Started deploying to #{fetch(:slack_stage)} by @#{fetch(:slack_deployer)}" +
|
49
49
|
" (branch #{fetch(:branch)})"
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
)
|
51
|
+
attachments = [{
|
52
|
+
color: "warning",
|
53
|
+
title: fetch(:application),
|
54
|
+
text: text,
|
55
|
+
fallback: text,
|
56
|
+
mrkdwn_in: ['text']
|
57
|
+
}]
|
58
|
+
|
59
|
+
if fetch(:slack_token)
|
60
|
+
fetch(:slack_default_body).merge(attachments: JSON.dump(attachments))
|
61
|
+
else
|
62
|
+
JSON.dump(fetch(:slack_default_body).merge(attachments: attachments))
|
63
|
+
end
|
60
64
|
}
|
61
65
|
|
62
66
|
set :slack_failure_body, -> {
|
63
67
|
text = "Failed deploying to #{fetch(:slack_stage)} by @#{fetch(:slack_deployer)}" +
|
64
68
|
" (branch #{fetch(:branch)} at #{fetch(:current_revision)} / #{elapsed_time.call} sec)"
|
65
69
|
|
66
|
-
|
67
|
-
attachments: JSON.dump([{
|
70
|
+
attachments = [{
|
68
71
|
color: 'danger',
|
69
72
|
title: fetch(:application),
|
70
73
|
text: text,
|
71
74
|
fallback: text,
|
72
75
|
mrkdwn_in: ['text']
|
73
|
-
|
74
|
-
|
76
|
+
}]
|
77
|
+
|
78
|
+
if fetch(:slack_token)
|
79
|
+
fetch(:slack_default_body).merge(attachments: JSON.dump(attachments))
|
80
|
+
else
|
81
|
+
JSON.dump(fetch(:slack_default_body).merge(attachments: attachments))
|
82
|
+
end
|
75
83
|
}
|
76
84
|
|
77
85
|
set :slack_success_body, -> {
|
@@ -79,15 +87,19 @@ namespace :slack do
|
|
79
87
|
text = "Successful #{task} to #{fetch(:slack_stage)} by @#{fetch(:slack_deployer)}" +
|
80
88
|
" (branch #{fetch(:branch)} at #{fetch(:current_revision)} / #{elapsed_time.call} sec)"
|
81
89
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
)
|
90
|
+
attachments = [{
|
91
|
+
color: 'good',
|
92
|
+
title: fetch(:application),
|
93
|
+
text: text,
|
94
|
+
fallback: text,
|
95
|
+
mrkdwn_in: ['text']
|
96
|
+
}]
|
97
|
+
|
98
|
+
if fetch(:slack_token)
|
99
|
+
fetch(:slack_default_body).merge(attachments: JSON.dump(attachments))
|
100
|
+
else
|
101
|
+
JSON.dump(fetch(:slack_default_body).merge(attachments: attachments))
|
102
|
+
end
|
91
103
|
}
|
92
104
|
|
93
105
|
set :slack_client, -> {
|
data/misc/preview.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-slack_notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/capistrano/slack_notification/version.rb
|
71
71
|
- lib/capistrano/tasks/slack_notification.rake
|
72
72
|
- misc/capistrano-icon.png
|
73
|
+
- misc/preview.png
|
73
74
|
homepage: https://github.com/linyows/capistrano-slack_notification
|
74
75
|
licenses:
|
75
76
|
- MIT
|
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
91
|
version: '0'
|
91
92
|
requirements: []
|
92
93
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.4.5
|
94
95
|
signing_key:
|
95
96
|
specification_version: 4
|
96
97
|
summary: Notify Capistrano deployment to Slack.
|