flowchef 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -0
- data/lib/flowchef.rb +2 -2
- data/lib/flowchef/version.rb +1 -1
- data/spec/flowchef_spec.rb +30 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d411b29d56632e177e76d2662df2c74d189c86b
|
4
|
+
data.tar.gz: c20a01b8b58df065c1053d48fbbf2a687163838d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5673b174c0591a2582002e4d20545e11040599c2f48853cfb2eac5d5dc80da7c6ff7d8e3e6f3688d873594920aaa7e09797349f9f109e01c2959f99a5457c61
|
7
|
+
data.tar.gz: 3ca3fbc04bde76cda38a166a394f1375b143db387d9a44b643d5f7005a865a3e6d35640f9b15390605c6b7968ab6ad280a41f85d193c4b578e6cd8d755566dc5
|
data/README.md
CHANGED
@@ -17,5 +17,24 @@ Or install it yourself as:
|
|
17
17
|
|
18
18
|
$ gem install flowchef
|
19
19
|
|
20
|
+
### Install on your chef client
|
21
|
+
|
22
|
+
We use a cookbook to manage our handlers, you can install this gem
|
23
|
+
in your own cookbook by adding this to your recipe.
|
24
|
+
|
25
|
+
chef_gem "flowchef" do
|
26
|
+
action :install
|
27
|
+
end
|
28
|
+
|
20
29
|
## Usage
|
21
30
|
|
31
|
+
You can use the [`chef_handler`](https://github.com/opscode-cookbooks/chef_handler) cookbook to
|
32
|
+
register it as so
|
33
|
+
|
34
|
+
chef_handler "Flowchef::NotifyInbox" do
|
35
|
+
source 'flowchef'
|
36
|
+
arguments [:api_token => "Your Flow API Token",
|
37
|
+
:tags => ["array","of","tags"]]
|
38
|
+
supports :exception => true
|
39
|
+
action :enable
|
40
|
+
end
|
data/lib/flowchef.rb
CHANGED
@@ -35,7 +35,7 @@ module Flowchef
|
|
35
35
|
|
36
36
|
def report
|
37
37
|
msg = <<-eos
|
38
|
-
<h2>Chef
|
38
|
+
<h2>Chef failures on #{node.name}</h2>
|
39
39
|
#{run_status.formatted_exception}
|
40
40
|
eos
|
41
41
|
flow = Flowdock::Flow.new(:api_token => @api_token,
|
@@ -44,7 +44,7 @@ module Flowchef
|
|
44
44
|
:address => "noreply@#{node.fqdn}"})
|
45
45
|
flow.push_to_team_inbox(:subject => "Chef failuers on #{node.name}",
|
46
46
|
:content => msg,
|
47
|
-
:tags =>
|
47
|
+
:tags => [])
|
48
48
|
end
|
49
49
|
|
50
50
|
def blank?(var)
|
data/lib/flowchef/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "flowchef"
|
2
|
+
|
3
|
+
describe Flowchef::NotifyInbox do
|
4
|
+
it "should create a new flowchef notifier for a single token" do
|
5
|
+
lambda {
|
6
|
+
Flowchef::NotifyInbox.new(:api_token => "test")
|
7
|
+
}.should_not raise_error
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should create a new flowchef notifier for an array of tokens" do
|
11
|
+
lambda {
|
12
|
+
Flowchef::NotifyInbox.new(:api_token => ["test", "test"])
|
13
|
+
}.should_not raise_error
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should set tags" do
|
17
|
+
lambda {
|
18
|
+
Flowchef::NotifyInbox.new(:api_token => "test",
|
19
|
+
:tags => ["tag1","tag2"])
|
20
|
+
}.should_not raise_error
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should fail (tags can only be strings)" do
|
24
|
+
lambda {
|
25
|
+
Flowchef::NotifyInbox.new(:api_token => "test",
|
26
|
+
:tags => ["tag1", Array])
|
27
|
+
}.should raise_error(Flowchef::NotifyInbox::InvalidParameterError)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flowchef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ómar Kjartan Yasin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- flowchef.gemspec
|
96
96
|
- lib/flowchef.rb
|
97
97
|
- lib/flowchef/version.rb
|
98
|
+
- spec/flowchef_spec.rb
|
98
99
|
homepage: ''
|
99
100
|
licenses:
|
100
101
|
- MIT
|
@@ -119,4 +120,5 @@ rubygems_version: 2.0.0
|
|
119
120
|
signing_key:
|
120
121
|
specification_version: 4
|
121
122
|
summary: ''
|
122
|
-
test_files:
|
123
|
+
test_files:
|
124
|
+
- spec/flowchef_spec.rb
|