jackal-slack 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +25 -0
- data/LICENSE +13 -0
- data/README.md +47 -0
- data/jackal-slack.gemspec +3 -2
- data/lib/jackal-slack/notification.rb +8 -5
- data/lib/jackal-slack/version.rb +1 -1
- metadata +10 -8
- data/jackal-slack-0.1.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6980d689b226ec49e46c83345747e323925fc2e3
|
4
|
+
data.tar.gz: 4088f36b9fa553d802b058d0456b53c7fdba260e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a161ae1220298898dd93268a79f4cf4d84f0fff44638234809efb82fd9a3b3c6b0ba2d2fe6b734a9543a6e48c155fb1a698abb83ca6e786d47eaa4552ea7409
|
7
|
+
data.tar.gz: f0fa4f05aeb87efea26997a7bcef4ba461207e04123430d5d7e274c261fc38bbaeaace6e912f15d202da7a473ddb70110fbd78e4b8276c798c0bb6cabf927c35
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
## Branches
|
4
|
+
|
5
|
+
### `master` branch
|
6
|
+
|
7
|
+
The master branch is the current stable released version.
|
8
|
+
|
9
|
+
### `develop` branch
|
10
|
+
|
11
|
+
The develop branch is the current edge of development.
|
12
|
+
|
13
|
+
## Pull requests
|
14
|
+
|
15
|
+
* https://github.com/carnivore-rb/jackal-slack/pulls
|
16
|
+
|
17
|
+
Please base all pull requests of the `develop` branch. Merges to
|
18
|
+
`master` only occur through the `develop` branch. Pull requests
|
19
|
+
based on `master` will likely be cherry picked.
|
20
|
+
|
21
|
+
## Issues
|
22
|
+
|
23
|
+
Need to report an issue? Use the github issues:
|
24
|
+
|
25
|
+
* https://github.com/carnivore-rb/jackal-slack/issues
|
data/LICENSE
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2014 Heavy Water
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Jackal Slack
|
2
|
+
|
3
|
+
Slack integration for sending notifications.
|
4
|
+
|
5
|
+
## Configuration
|
6
|
+
|
7
|
+
Requires configured webhook endpoint from Slack:
|
8
|
+
|
9
|
+
```json
|
10
|
+
{
|
11
|
+
"jackal": {
|
12
|
+
"config": {
|
13
|
+
"slack": {
|
14
|
+
"webhook": SLACK_WEBHOOK
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
```
|
20
|
+
|
21
|
+
## Payload structure
|
22
|
+
|
23
|
+
Structure within the payload supported:
|
24
|
+
|
25
|
+
```json
|
26
|
+
{
|
27
|
+
"data": {
|
28
|
+
"slack": {
|
29
|
+
"messages": [
|
30
|
+
{
|
31
|
+
"message": MESSAGE_TO_DISPLAY,
|
32
|
+
"color": SLACK_COLOR,
|
33
|
+
"description": SLACK_TITLE,
|
34
|
+
"markdown": APPLY_MARKDOWN
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
```
|
41
|
+
|
42
|
+
Markdown formatting is enabled by default.
|
43
|
+
|
44
|
+
# Info
|
45
|
+
|
46
|
+
* Repository: https://github.com/carnivore-rb/jackal-slack
|
47
|
+
* IRC: Freenode @ #carnivore
|
data/jackal-slack.gemspec
CHANGED
@@ -8,8 +8,9 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.email = 'support@hw-ops.com'
|
9
9
|
s.homepage = 'http://github.com/heavywater/jackal-slack'
|
10
10
|
s.description = 'Jackal Slack'
|
11
|
+
s.license = 'Apache 2.0'
|
11
12
|
s.require_path = 'lib'
|
12
13
|
s.add_dependency 'jackal'
|
13
|
-
s.add_dependency 'slack-notifier'
|
14
|
-
s.files = Dir['
|
14
|
+
s.add_dependency 'slack-notifier', '~> 1.0'
|
15
|
+
s.files = Dir['lib/**/*'] + %w(jackal-slack.gemspec README.md CHANGELOG.md CONTRIBUTING.md LICENSE)
|
15
16
|
end
|
@@ -23,14 +23,17 @@ module Jackal
|
|
23
23
|
payload[:data][:slack][:messages].each do |slack_msg|
|
24
24
|
notifier = slack_notifier
|
25
25
|
msg = slack_msg[:message].to_s
|
26
|
-
|
26
|
+
msg_attachment = {
|
27
27
|
fallback: msg,
|
28
28
|
text: msg,
|
29
|
-
color: slack_msg[:color]
|
29
|
+
color: slack_msg[:color],
|
30
|
+
mrkdwn_in: slack_msg.fetch(:markdown, true) ? [:text, :fallback] : []
|
30
31
|
}
|
31
|
-
notifier.ping(
|
32
|
+
notifier.ping(
|
33
|
+
slack_msg.fetch(:description, 'Result:'),
|
34
|
+
attachments: [msg_attachment]
|
35
|
+
)
|
32
36
|
end
|
33
|
-
|
34
37
|
job_completed(:slack_notification, payload, message)
|
35
38
|
end
|
36
39
|
end
|
@@ -38,7 +41,7 @@ module Jackal
|
|
38
41
|
# Return slack_notifier object using team & token from data or config
|
39
42
|
# depending on what's loaded in the environment
|
40
43
|
def slack_notifier
|
41
|
-
::Slack::Notifier.new(config[:
|
44
|
+
::Slack::Notifier.new(config[:webhook_url])
|
42
45
|
end
|
43
46
|
|
44
47
|
end
|
data/lib/jackal-slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackal-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Heavywater
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jackal
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: slack-notifier
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '1.0'
|
41
41
|
description: Jackal Slack
|
42
42
|
email: support@hw-ops.com
|
43
43
|
executables: []
|
@@ -45,14 +45,16 @@ extensions: []
|
|
45
45
|
extra_rdoc_files: []
|
46
46
|
files:
|
47
47
|
- CHANGELOG.md
|
48
|
+
- CONTRIBUTING.md
|
49
|
+
- LICENSE
|
48
50
|
- README.md
|
49
|
-
- jackal-slack-0.1.1.gem
|
50
51
|
- jackal-slack.gemspec
|
51
52
|
- lib/jackal-slack.rb
|
52
53
|
- lib/jackal-slack/notification.rb
|
53
54
|
- lib/jackal-slack/version.rb
|
54
55
|
homepage: http://github.com/heavywater/jackal-slack
|
55
|
-
licenses:
|
56
|
+
licenses:
|
57
|
+
- Apache 2.0
|
56
58
|
metadata: {}
|
57
59
|
post_install_message:
|
58
60
|
rdoc_options: []
|
data/jackal-slack-0.1.1.gem
DELETED
Binary file
|