knife-spork-berks 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +19 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +284 -0
- data/Gemfile +3 -0
- data/LICENSE +35 -0
- data/README.md +406 -0
- data/Rakefile +2 -0
- data/knife-spork-berks.gemspec +22 -0
- data/lib/chef/knife/spork-bump.rb +86 -0
- data/lib/chef/knife/spork-check.rb +149 -0
- data/lib/chef/knife/spork-databag-create.rb +53 -0
- data/lib/chef/knife/spork-databag-delete.rb +51 -0
- data/lib/chef/knife/spork-databag-edit.rb +54 -0
- data/lib/chef/knife/spork-databag-fromfile.rb +82 -0
- data/lib/chef/knife/spork-environment-create.rb +43 -0
- data/lib/chef/knife/spork-environment-delete.rb +36 -0
- data/lib/chef/knife/spork-environment-edit.rb +37 -0
- data/lib/chef/knife/spork-environment-fromfile.rb +42 -0
- data/lib/chef/knife/spork-info.rb +30 -0
- data/lib/chef/knife/spork-node-create.rb +38 -0
- data/lib/chef/knife/spork-node-delete.rb +38 -0
- data/lib/chef/knife/spork-node-edit.rb +45 -0
- data/lib/chef/knife/spork-node-fromfile.rb +43 -0
- data/lib/chef/knife/spork-node-runlistadd.rb +48 -0
- data/lib/chef/knife/spork-node-runlistremove.rb +42 -0
- data/lib/chef/knife/spork-node-runlistset.rb +42 -0
- data/lib/chef/knife/spork-omni.rb +107 -0
- data/lib/chef/knife/spork-promote.rb +166 -0
- data/lib/chef/knife/spork-role-create.rb +43 -0
- data/lib/chef/knife/spork-role-delete.rb +36 -0
- data/lib/chef/knife/spork-role-edit.rb +37 -0
- data/lib/chef/knife/spork-role-fromfile.rb +42 -0
- data/lib/chef/knife/spork-upload.rb +129 -0
- data/lib/knife-spork.rb +3 -0
- data/lib/knife-spork/plugins.rb +25 -0
- data/lib/knife-spork/plugins/campfire.rb +211 -0
- data/lib/knife-spork/plugins/eventinator.rb +317 -0
- data/lib/knife-spork/plugins/foodcritic.rb +46 -0
- data/lib/knife-spork/plugins/git.rb +197 -0
- data/lib/knife-spork/plugins/graphite.rb +25 -0
- data/lib/knife-spork/plugins/grove.rb +161 -0
- data/lib/knife-spork/plugins/hipchat.rb +131 -0
- data/lib/knife-spork/plugins/irccat.rb +298 -0
- data/lib/knife-spork/plugins/jabber.rb +129 -0
- data/lib/knife-spork/plugins/plugin.rb +105 -0
- data/lib/knife-spork/plugins/statusnet.rb +118 -0
- data/lib/knife-spork/runner.rb +277 -0
- data/plugins/Campfire.md +43 -0
- data/plugins/Eventinator.md +30 -0
- data/plugins/Foodcritic.md +53 -0
- data/plugins/Git.md +46 -0
- data/plugins/Graphite.md +30 -0
- data/plugins/Grove.md +31 -0
- data/plugins/HipChat.md +50 -0
- data/plugins/Irccat.md +50 -0
- data/plugins/Jabber.md +61 -0
- data/plugins/README.md +70 -0
- data/plugins/StatusNet.md +41 -0
- data/plugins/Template.md +34 -0
- metadata +170 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
Foodcritic
|
2
|
+
==========
|
3
|
+
Automatically runs foodcritic against your cookbooks on check and upload.
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'foodcritic' >= 3.0.0
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `after_check`
|
16
|
+
- `before_upload`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
foodcritic:
|
23
|
+
tags:
|
24
|
+
- FC0023
|
25
|
+
fail_tags:
|
26
|
+
- any
|
27
|
+
include_rules:
|
28
|
+
- foodcritic/etsy
|
29
|
+
epic_fail: true
|
30
|
+
```
|
31
|
+
|
32
|
+
#### tags
|
33
|
+
The tags to check against.
|
34
|
+
|
35
|
+
- Type: `Array`
|
36
|
+
- Default: '[any]'
|
37
|
+
|
38
|
+
#### fail_tags
|
39
|
+
The list of tags to fail on.
|
40
|
+
|
41
|
+
- Type: 'Array'
|
42
|
+
- Default: '[any]'
|
43
|
+
|
44
|
+
#### include_rules
|
45
|
+
An optional list of additional rules to run.
|
46
|
+
|
47
|
+
- Type: `Array`
|
48
|
+
|
49
|
+
#### epic_fail:
|
50
|
+
If set to true, `epic_fail` will prevent you from uploading a cookbook until all foodcritic rules pass.
|
51
|
+
|
52
|
+
- Type: `Boolean`
|
53
|
+
- Default: `true`
|
data/plugins/Git.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
Git
|
2
|
+
===
|
3
|
+
This plugin attempts to help manage your workflow by automatically pulling changes from your repo. **Do not use this plugin if you are not using Git.**
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'git'
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `before_bump`
|
16
|
+
- `after_bump`
|
17
|
+
- `after_promote`
|
18
|
+
|
19
|
+
Configuration
|
20
|
+
-------------
|
21
|
+
```yaml
|
22
|
+
plugins:
|
23
|
+
git:
|
24
|
+
remote: origin
|
25
|
+
branch: master
|
26
|
+
```
|
27
|
+
|
28
|
+
**Note** Due to the nature of the git plugin, it's possible that you accept all the defaults. In that case, you should make your configuration like this:
|
29
|
+
|
30
|
+
```yaml
|
31
|
+
plugins:
|
32
|
+
git:
|
33
|
+
enabled: true
|
34
|
+
```
|
35
|
+
|
36
|
+
#### remote
|
37
|
+
The git remote to push/pull to/from.
|
38
|
+
|
39
|
+
- Type: `String`
|
40
|
+
- Default: `origin`
|
41
|
+
|
42
|
+
#### branch
|
43
|
+
The git branch to push/pull to/from.
|
44
|
+
|
45
|
+
- Type: `String`
|
46
|
+
- Default: `master`
|
data/plugins/Graphite.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
Graphite
|
2
|
+
========
|
3
|
+
Graphite will automatically send a request to your Graphite server under the deploys.chef.[environment] for graphical analysis.
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin has no gem requirements.
|
8
|
+
|
9
|
+
Hooks
|
10
|
+
-----
|
11
|
+
- `after_promote`
|
12
|
+
|
13
|
+
Configuration
|
14
|
+
-------------
|
15
|
+
```yaml
|
16
|
+
plugins:
|
17
|
+
graphite:
|
18
|
+
server: graphite.example.com
|
19
|
+
port: 12345
|
20
|
+
```
|
21
|
+
|
22
|
+
#### server
|
23
|
+
The url to the graphite server
|
24
|
+
|
25
|
+
- Type: `String`
|
26
|
+
|
27
|
+
#### port
|
28
|
+
The port of the graphite server
|
29
|
+
|
30
|
+
- Type: `Integer`
|
data/plugins/Grove.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
Campfire
|
2
|
+
========
|
3
|
+
Automatically posts informational messages to Grove.io
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rest_client'
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `after_promote`
|
16
|
+
- `after_upload`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
grove:
|
23
|
+
tokens:
|
24
|
+
- ABC
|
25
|
+
- XYZ
|
26
|
+
```
|
27
|
+
|
28
|
+
#### Tokens
|
29
|
+
This is an array of tokens (channels) to post messages to.
|
30
|
+
|
31
|
+
- Type: `String`
|
data/plugins/HipChat.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
HipChat
|
2
|
+
=======
|
3
|
+
HipChat posts messages to your HipChat client.
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'hipchat'
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `after_upload`
|
16
|
+
- `after_promote`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
hipchat:
|
23
|
+
api_token: ABC123
|
24
|
+
rooms:
|
25
|
+
- General
|
26
|
+
- Web Operations
|
27
|
+
notify: true
|
28
|
+
color: yellow
|
29
|
+
```
|
30
|
+
|
31
|
+
#### api_token
|
32
|
+
Your HipChat API token.
|
33
|
+
|
34
|
+
- Type: `String`
|
35
|
+
|
36
|
+
#### rooms
|
37
|
+
The list of rooms to post to.
|
38
|
+
|
39
|
+
- Type: `Array`
|
40
|
+
|
41
|
+
#### notify
|
42
|
+
Boolean value indicating whether the room should be notified.
|
43
|
+
|
44
|
+
- Type: `Boolean`
|
45
|
+
|
46
|
+
#### color
|
47
|
+
THe color of the message.
|
48
|
+
|
49
|
+
- Type: `String`
|
50
|
+
- Acceptable Values: `[yellow, red, green, purple, random]`
|
data/plugins/Irccat.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
Plugin Name
|
2
|
+
===========
|
3
|
+
This plugin interfaces with the irccat IRC bot (https://github.com/RJ/irccat)
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin has no gem requirements.`
|
8
|
+
|
9
|
+
Hooks
|
10
|
+
-----
|
11
|
+
- `after_promote`
|
12
|
+
|
13
|
+
Configuration
|
14
|
+
-------------
|
15
|
+
```yaml
|
16
|
+
plugins:
|
17
|
+
irccat:
|
18
|
+
server: irc.example.com
|
19
|
+
port: 54
|
20
|
+
channels:
|
21
|
+
- #chef
|
22
|
+
- #knife
|
23
|
+
gist: "/usr/bin/gist"
|
24
|
+
template:
|
25
|
+
upload: "foo bar! #REDCHEF:#NORMAL %{organization}%{current_user} uploaded #GREEN%{cookbooks}#NORMAL"
|
26
|
+
```
|
27
|
+
|
28
|
+
#### server
|
29
|
+
The url of the IRC server.
|
30
|
+
|
31
|
+
- Type: `String`
|
32
|
+
|
33
|
+
#### port
|
34
|
+
The port of the IRC server.
|
35
|
+
|
36
|
+
- Type: `String`
|
37
|
+
|
38
|
+
#### channels
|
39
|
+
The channels to post to.
|
40
|
+
|
41
|
+
- Type: `Array`
|
42
|
+
|
43
|
+
#### gist
|
44
|
+
Optional path to gist binary installed by https://rubygems.org/gems/gist
|
45
|
+
|
46
|
+
- Type: `String`
|
47
|
+
|
48
|
+
|
49
|
+
### template
|
50
|
+
Optional irccat message template if you want to change the formatting of irccat alerts. Supports overriding alerts for upload and promote
|
data/plugins/Jabber.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
Jabber
|
2
|
+
=======
|
3
|
+
Jabber posts messages to a designated Jabber group chat room.
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'xmpp4r'
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `after_upload`
|
16
|
+
- `after_promote`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
jabber:
|
23
|
+
username: YOURUSER
|
24
|
+
password: YOURPASSWORD
|
25
|
+
nickname: Chef Bot
|
26
|
+
server_name: your.jabberserver.com
|
27
|
+
server_port: 5222
|
28
|
+
rooms:
|
29
|
+
- engineering@your.conference.com/spork
|
30
|
+
- systems@your.conference.com/spork
|
31
|
+
```
|
32
|
+
|
33
|
+
#### username
|
34
|
+
Your Jabber username.
|
35
|
+
|
36
|
+
- Type: `String`
|
37
|
+
|
38
|
+
#### password
|
39
|
+
Your Jabber password.
|
40
|
+
|
41
|
+
- Type: `String`
|
42
|
+
|
43
|
+
#### nickname
|
44
|
+
A nickname to use in the conference room when making announcements.
|
45
|
+
|
46
|
+
- Type: `String`
|
47
|
+
|
48
|
+
#### server_name
|
49
|
+
Your Jabber server name.
|
50
|
+
|
51
|
+
- Type: `String`
|
52
|
+
|
53
|
+
#### server_port
|
54
|
+
Your Jabber server port number. Default: 5222
|
55
|
+
|
56
|
+
- Type: `String`
|
57
|
+
|
58
|
+
#### rooms
|
59
|
+
The list of rooms to post to.
|
60
|
+
|
61
|
+
- Type: `Array`
|
data/plugins/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
Plugins Directory
|
2
|
+
=================
|
3
|
+
This folder contains relevant documentation for each KnifeSpork plugin. For more information, usage, and options for an particular plugin, click on the assoicated markdown file in the tree above.
|
4
|
+
|
5
|
+
Creating a Plugin
|
6
|
+
-----------------
|
7
|
+
To create a plugin, start with the following basic boiler template:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
require 'knife-spork/plugins/plugin'
|
11
|
+
|
12
|
+
module KnifeSpork
|
13
|
+
module Plugins
|
14
|
+
class MyPlugin < Plugin
|
15
|
+
name :my_plugin
|
16
|
+
|
17
|
+
def perform
|
18
|
+
# your plugin code here
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
```
|
24
|
+
|
25
|
+
**Don't forget to update the class name and the `name` at the very top of the class!**
|
26
|
+
|
27
|
+
Helpers
|
28
|
+
-------
|
29
|
+
The following "helpers" or "methods" are exposed:
|
30
|
+
|
31
|
+
#### safe_require
|
32
|
+
This method allows you to safely require a gem. This is helpful when your plugin requires an external plugin. It will output a nice error message if the gem cannot be loaded and stop executing.
|
33
|
+
|
34
|
+
#### current_user
|
35
|
+
This method tries to get the current user's name in the following manner:
|
36
|
+
|
37
|
+
1. From the git configuration
|
38
|
+
2. From the `ENV`
|
39
|
+
|
40
|
+
#### config
|
41
|
+
This method returns the config associated with the current plugin. For example, if a `spork-config.yml` file looked like this:
|
42
|
+
|
43
|
+
```yaml
|
44
|
+
plugins:
|
45
|
+
my_plugin:
|
46
|
+
option_1: my_value
|
47
|
+
option_2: other_value
|
48
|
+
```
|
49
|
+
|
50
|
+
then
|
51
|
+
|
52
|
+
```text
|
53
|
+
config.option_1 #=> 'my_value'
|
54
|
+
config.option_2 #=> 'other_value'
|
55
|
+
```
|
56
|
+
|
57
|
+
This uses `app_conf`, so you access the keys are methods, not `[]`.
|
58
|
+
|
59
|
+
#### cookbooks
|
60
|
+
This returns an array of `Chef::CookbookVersion` objects corresponding to the cookbooks that are being changed/altered in the hook. For more information on the methods avaliable, see the [file in the Chef repo](https://github.com/opscode/chef/blob/master/chef/lib/chef/cookbook_version.rb).
|
61
|
+
|
62
|
+
#### environments
|
63
|
+
This returns an array of `Chef::Environment` objects corresponding to the environments that are being changed/altered in the hook. For more information on the methods avaliable, see the [file in the Chef repo](https://github.com/opscode/chef/blob/master/chef/lib/chef/environment.rb).
|
64
|
+
|
65
|
+
#### environment_diffs
|
66
|
+
This returns a Hash of Hash objects containing a diff between local and remote environment for each environment changed/altered in the hook. Currently, this will only be populated during the promotea action.
|
67
|
+
|
68
|
+
|
69
|
+
#### ui
|
70
|
+
This returns a `Chef::Knife::UI` element for outputting to the console. For more information on the methods avaliable, see the [file in the Chef repo](https://github.com/opscode/chef/blob/master/chef/lib/chef/knife/core/ui.rb).
|
@@ -0,0 +1,41 @@
|
|
1
|
+
StatusNet
|
2
|
+
=======
|
3
|
+
StatusNet posts messages to a your StatusNet instance
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'curb'
|
11
|
+
```
|
12
|
+
|
13
|
+
Hooks
|
14
|
+
-----
|
15
|
+
- `after_upload`
|
16
|
+
- `after_promote`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
statusnet:
|
23
|
+
url: YOUR INSTANCE API URL
|
24
|
+
username: YOURUSER
|
25
|
+
password: YOURPASSWORD
|
26
|
+
```
|
27
|
+
|
28
|
+
#### url
|
29
|
+
Your StatusNet instance API url, usually server url + /api/statuses/update.xml
|
30
|
+
|
31
|
+
- Type: `Srtring`
|
32
|
+
|
33
|
+
#### username
|
34
|
+
Your StatusNet username.
|
35
|
+
|
36
|
+
- Type: `String`
|
37
|
+
|
38
|
+
#### password
|
39
|
+
Your StatusNet password.
|
40
|
+
|
41
|
+
- Type: `String`
|
data/plugins/Template.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
Plugin Name
|
2
|
+
===========
|
3
|
+
Here is an optional, short description about your plugin.
|
4
|
+
|
5
|
+
Gem Requirements
|
6
|
+
----------------
|
7
|
+
This plugin requires the following gems:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'my_gem', '~> 1.4.5'
|
11
|
+
gem 'other_gem', '>= 5.0.1'
|
12
|
+
```
|
13
|
+
|
14
|
+
Hooks
|
15
|
+
-----
|
16
|
+
- `after_promote`
|
17
|
+
|
18
|
+
Configuration
|
19
|
+
-------------
|
20
|
+
```yaml
|
21
|
+
plugins:
|
22
|
+
plugin_name:
|
23
|
+
option_1: true
|
24
|
+
option_2:
|
25
|
+
- a
|
26
|
+
- b
|
27
|
+
- c
|
28
|
+
```
|
29
|
+
|
30
|
+
#### option_1
|
31
|
+
This is a description of the option.
|
32
|
+
|
33
|
+
- Type: `String`
|
34
|
+
- Default: `ABC`
|