knife-spork-berks 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +19 -0
  2. data/.ruby-gemset +1 -0
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.md +284 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +35 -0
  7. data/README.md +406 -0
  8. data/Rakefile +2 -0
  9. data/knife-spork-berks.gemspec +22 -0
  10. data/lib/chef/knife/spork-bump.rb +86 -0
  11. data/lib/chef/knife/spork-check.rb +149 -0
  12. data/lib/chef/knife/spork-databag-create.rb +53 -0
  13. data/lib/chef/knife/spork-databag-delete.rb +51 -0
  14. data/lib/chef/knife/spork-databag-edit.rb +54 -0
  15. data/lib/chef/knife/spork-databag-fromfile.rb +82 -0
  16. data/lib/chef/knife/spork-environment-create.rb +43 -0
  17. data/lib/chef/knife/spork-environment-delete.rb +36 -0
  18. data/lib/chef/knife/spork-environment-edit.rb +37 -0
  19. data/lib/chef/knife/spork-environment-fromfile.rb +42 -0
  20. data/lib/chef/knife/spork-info.rb +30 -0
  21. data/lib/chef/knife/spork-node-create.rb +38 -0
  22. data/lib/chef/knife/spork-node-delete.rb +38 -0
  23. data/lib/chef/knife/spork-node-edit.rb +45 -0
  24. data/lib/chef/knife/spork-node-fromfile.rb +43 -0
  25. data/lib/chef/knife/spork-node-runlistadd.rb +48 -0
  26. data/lib/chef/knife/spork-node-runlistremove.rb +42 -0
  27. data/lib/chef/knife/spork-node-runlistset.rb +42 -0
  28. data/lib/chef/knife/spork-omni.rb +107 -0
  29. data/lib/chef/knife/spork-promote.rb +166 -0
  30. data/lib/chef/knife/spork-role-create.rb +43 -0
  31. data/lib/chef/knife/spork-role-delete.rb +36 -0
  32. data/lib/chef/knife/spork-role-edit.rb +37 -0
  33. data/lib/chef/knife/spork-role-fromfile.rb +42 -0
  34. data/lib/chef/knife/spork-upload.rb +129 -0
  35. data/lib/knife-spork.rb +3 -0
  36. data/lib/knife-spork/plugins.rb +25 -0
  37. data/lib/knife-spork/plugins/campfire.rb +211 -0
  38. data/lib/knife-spork/plugins/eventinator.rb +317 -0
  39. data/lib/knife-spork/plugins/foodcritic.rb +46 -0
  40. data/lib/knife-spork/plugins/git.rb +197 -0
  41. data/lib/knife-spork/plugins/graphite.rb +25 -0
  42. data/lib/knife-spork/plugins/grove.rb +161 -0
  43. data/lib/knife-spork/plugins/hipchat.rb +131 -0
  44. data/lib/knife-spork/plugins/irccat.rb +298 -0
  45. data/lib/knife-spork/plugins/jabber.rb +129 -0
  46. data/lib/knife-spork/plugins/plugin.rb +105 -0
  47. data/lib/knife-spork/plugins/statusnet.rb +118 -0
  48. data/lib/knife-spork/runner.rb +277 -0
  49. data/plugins/Campfire.md +43 -0
  50. data/plugins/Eventinator.md +30 -0
  51. data/plugins/Foodcritic.md +53 -0
  52. data/plugins/Git.md +46 -0
  53. data/plugins/Graphite.md +30 -0
  54. data/plugins/Grove.md +31 -0
  55. data/plugins/HipChat.md +50 -0
  56. data/plugins/Irccat.md +50 -0
  57. data/plugins/Jabber.md +61 -0
  58. data/plugins/README.md +70 -0
  59. data/plugins/StatusNet.md +41 -0
  60. data/plugins/Template.md +34 -0
  61. metadata +170 -0
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .project
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ .idea
@@ -0,0 +1 @@
1
+ knife-spork
@@ -0,0 +1 @@
1
+ 1.9.3-p448
@@ -0,0 +1,284 @@
1
+ ## 1.3.2 (5th Feb, 2014)
2
+
3
+ Features:
4
+
5
+ - Add spork environment commands (Thanks to @jperry https://github.com/jonlives/knife-spork/pull/102)
6
+ - Berkshelf support for bump and check commands (Thanks to @poliva83 https://github.com/jonlives/knife-spork/pull/104)
7
+
8
+ ## 1.3.1 (31st Dec, 2013)
9
+
10
+ Features:
11
+
12
+ - Add a cookbook_path option to spork bump (https://github.com/jonlives/knife-spork/issues/92)
13
+ - Add config option to promote --remote by default (https://github.com/jonlives/knife-spork/issues/95)
14
+
15
+ Bugfixes:
16
+
17
+ - Fix issue with gist generation in the irccat plugin breaking when json diffs were incorrectly escaped ((https://github.com/jonlives/knife-spork/issues/97)
18
+ - Fix issue with data bag upload when file path is specified (https://github.com/jonlives/knife-spork/issues/98)
19
+
20
+ ## 1.3.0 (23rd October, 2013)
21
+
22
+ Features:
23
+
24
+ - Allow a custom plugin path to be specified in config to load additional plugins from (https://github.com/jonlives/knife-spork/issues/59)
25
+ - Spork check will prompt for a bump if one is needed (https://github.com/jonlives/knife-spork/issues/82)
26
+ - Spork omni command added to perform bump, upload and promote in a single step (https://github.com/jonlives/knife-spork/issues/49)
27
+ - Spork role, data bag and node commands added (https://github.com/jonlives/knife-spork/issues/81)
28
+
29
+ Bugfixes:
30
+
31
+ - Remove legacy code referring to "promote all cookbooks" (https://github.com/jonlives/knife-spork/issues/76)
32
+ - Fix incorrect cookbook version numbers in plugin output when -v used with promote (https://github.com/jonlives/knife-spork/issues/64)
33
+ - Replaced monkeypatched Hash#diff with an hash_diff method to fix clashes with ActiveSupport deprecation warnings. (Thanks to @RSO: https://github.com/jonlives/knife-spork/pull/84)
34
+ - Various fixes for Berkshelf issues (Thanks to @RSO and @sethvargo: https://github.com/jonlives/knife-spork/issues/73)
35
+ - Fix load_from_berkshelf method to return a CookbookVersion object (Thanks to @hanskrueger https://github.com/jonlives/knife-spork/pull/90)
36
+ - Fix foodcritic plugin to work properly with foodcritic > 3.0.0 (Thanks to @juliandunn https://github.com/jonlives/knife-spork/pull/94)
37
+
38
+ ## 1.2.2 (10th Sept, 2013)
39
+
40
+ Bugfixes:
41
+
42
+ - Fix bug with promoting when environment groups are present (thanks to Jimmy Chao & Nik Keating - https://github.com/CaseCommonsDevOps)
43
+
44
+ ## 1.2.1 (28th June, 2013)
45
+
46
+ Bugfixes:
47
+
48
+ - Fix potential error with environment_groups (thanks to Greg Karékinian - https://github.com/gkarekinian)
49
+
50
+ ## 1.2.0 (28th June, 2013)
51
+
52
+ Features:
53
+
54
+ - StatusNet plugin (Thanks to Tomasz Napierala - https://github.com/zen)
55
+ - GroveIO plugin (Thanks to Greg Karékinian - https://github.com/gkarekinian)
56
+ - Configurable irccat message templates (Thanks to Tobias Schmidt - https://github.com/grobie)
57
+ - Environment Groups - Spork Promote can update multitiple environments at once by specifying the environment group name. (Thanks to Pivotal Casebook - https://github.com/pivotal-casebook)
58
+
59
+ Bugfixes:
60
+
61
+ - Fix spork bump to not change quote style or whitespace (Thanks to Tobias Schmidt - https://github.com/grobie)
62
+ - Correct Markdown formatting error (Thanks to Jeff Blaine - https://github.com/jblaine)
63
+ - Fix pretty printing of environments (Thanks to Peter Schultz - https://github.com/pschultz)
64
+
65
+ ## 1.0.17 (15th February, 2013)
66
+
67
+ Bugfixes:
68
+
69
+ - Fix git plugin to work nicely with Cygwin and its unpredictable exit codes
70
+
71
+ ## 1.0.16 (13th February, 2013)
72
+
73
+ Bugfixes:
74
+
75
+ - Reverted broken foodcritic plugin to that in 1.0.14
76
+
77
+ ## 1.0.15 (12th February, 2013)
78
+
79
+ Bugfixes:
80
+
81
+ - Fixed git plugin so that when working on a submodule, submodules will be git pulled from the parent repo instead
82
+ - Fixed foodcritic plugin bug where certain tag formats weren't being passed through
83
+
84
+ ## 1.0.14 (15th January, 2013)
85
+
86
+ Features:
87
+
88
+ - Campfire plugin changed to use campy gem (thanks to Seth Vargo)
89
+ - Organization name now added to messages when present (thanks to Seth Vargo)
90
+ - Berkshelf support now added (thanks to Seth Vargo)
91
+
92
+ Bugfixes:
93
+
94
+ - Promote won't try to create a version diff if there is no existing remote version (thanks to Seth Vargo)
95
+
96
+ ## 1.0.13 (9th January, 2013)
97
+
98
+ Features:
99
+
100
+ - Made spork promote Use environment_path from spork config if it's set( thanks to Greg Karékinian - https://github.com/gkarekinian)
101
+
102
+ ## 1.0.12 (22nd November, 2012)
103
+ Bugfixes:
104
+
105
+ - Fix bug where cookbook dependancy loading broke in older chef client versions as a result of a fix in 1.0.10
106
+
107
+ ## 1.0.11 (22nd November, 2012)
108
+
109
+ Yanked
110
+
111
+ ## 1.0.10 (22nd November, 2012)
112
+ Bugfixes:
113
+
114
+ - Load all cookbook versions from remote server when checking dependencies (thanks to gmcmillan)
115
+ - Fix case where git plugin would update a previously loaded cookbook, resulting in out of data metadata being used. (thanks to zsol)
116
+
117
+ ## 1.0.9 (28th October, 2012)
118
+ Features:
119
+
120
+ - Jabber Plugin (thanks to Graham McMillan - https://github.com/gmcmillan)
121
+
122
+ Bugfixes:
123
+
124
+ - Fix exception when spork promote called with no arguments (thanks to Julian Dunn - https://github.com/juliandunn)
125
+
126
+ ## 1.0.8 (25th September, 2012)
127
+ Bugfixes:
128
+
129
+ - Fix whitespace warnings which occur in the git plugin under Ruby 1.8
130
+
131
+ ## 1.0.7 (25th September, 2012)
132
+ Bugfixes:
133
+
134
+ - Fix invalid syntax in Hipchat plugin
135
+
136
+ ## 1.0.6 (25th September, 2012)
137
+ Bugfixes:
138
+
139
+ - Fix for disabling plugins when override config files are present
140
+
141
+ ## 1.0.5 (24th September, 2012)
142
+ Bugfixes:
143
+
144
+ - Fixes for hipchat plugin
145
+
146
+ ## 1.0.4 (14th September, 2012)
147
+ Features:
148
+
149
+ - Spork can now run command from any directory, not just the root of your chef repository.
150
+
151
+ Bugfixes:
152
+
153
+ - Fixed spork uploader to work more cleanly with 10.14.0 and greater
154
+ - Spork bump will no longer throw errors when no cookbook name is specified
155
+
156
+ ## 1.0.3 (10th September, 2012)
157
+ Bugfixes:
158
+
159
+ - Fix spork upload when using Chef 10.14.0
160
+ - Optional config override for chef environment location (not documented in README until 1.0.4)
161
+
162
+ ## 1.0.2 (28th August, 2012)
163
+ Bugfixes:
164
+
165
+ - Fix bug which caused plugin errors when no spork config file could be found
166
+
167
+ ## 1.0.1 (27th August, 2012)
168
+ Bugfixes:
169
+
170
+ - Fix require error which broke spork on CentOS 5.6
171
+
172
+ ## 1.0.0 (27th August, 2012)
173
+ Features:
174
+
175
+ - Major refactor (initial refactor: Seth Vargo)
176
+ - Plugin API (Seth Vargo)
177
+ - Added "spork info" command to show config hash and plugins status
178
+ - Missing local / remote cookbook now handled nicely in spork check
179
+ - Add "--fail" option to spork check to "exit 1" if check fails
180
+ - Git plugin now uses git gem instead of shelling out
181
+ - Confirmation check on promote if version jumps more than version_change_threshold
182
+ - Thanks also to jperry, bethanybenzur and nickmarden for contributions submitted pre-refactor which have been included in one form or another.
183
+
184
+
185
+
186
+ ## 0.1.11 (5th June, 2012)
187
+ Features:
188
+
189
+ - Hipchat Support (courtesy of Chris Ferry: @cdferry)
190
+
191
+ Bugfixes:
192
+
193
+ - Tweaks to spork bump to play nicely with x.x versions as well as x.x.x (courtesy of Russ Garrett: @russss)
194
+
195
+ ## 0.1.10 (12th April, 2012)
196
+ Features:
197
+
198
+ - All spork plugins now support multiple cookbook paths
199
+
200
+ Bugfixes:
201
+
202
+ - Fixes to work with app_conf 0.4.0
203
+
204
+ ## 0.1.9 (3rd April, 2012)
205
+
206
+ Features:
207
+
208
+ - Spork Promote will now git add updated environment files if git is enabled
209
+ - Spork Promote will optionally revert local changes to environment files if multiple changes were detected.
210
+ - Spork Bump will now perform a git pull and pull from submodules if git is enabled
211
+ - Optional Foodcritic integration added for Spork Upload
212
+ - ickymettle's Eventinator service now optionally supported
213
+
214
+ Bugfixes:
215
+
216
+ - Correct irccat alerts to not fire if cookbook upload fails
217
+ - Code cleanup to remove unused Opscode code from Spork Upload
218
+
219
+ ## 0.1.8 (21st February, 2012)
220
+
221
+ Features:
222
+
223
+ - Make promote --remote check if the correct version of the cookbook has been uploaded before updating the remote environment
224
+
225
+ ## 0.1.7 (21st February, 2012)
226
+
227
+ Bugfixes:
228
+
229
+ - Make promote --remote work nicely when not run from chef repo root
230
+
231
+ ## 0.1.6 (21st February, 2012)
232
+ Features:
233
+
234
+ - Spork Bump now defaults to "patch" if bump level not specified
235
+ - Spork Promote will prompt for confirmation if you're about to promote --remote changes to any cookbooks *other* than the one you specified on the command line. This should help avoid accidentally over-writing someone elses changes.
236
+ - Irccat messages now support multiple channels
237
+ - During promote, if git pull fails, ie a merge conflict has arisen, the error will be shown and promote will exit.
238
+ - Spork Promote will now also update git submodules before promoting. Specifically, it will run "git submodule foreach git pull"
239
+ - Failures during "git add" on spork bumps have a more helpful error message
240
+ - Irccat messages are now more nicely formatted and have pretty colours.
241
+
242
+ Bugfixes:
243
+
244
+ - Spork Promote will now work from anywhere in your chef repo, not just the repo root
245
+
246
+ ## 0.1.5 (21st February, 2012)
247
+
248
+ Yanked
249
+
250
+ ## 0.1.4 (3rd February, 2012)
251
+
252
+ Features:
253
+
254
+ - Spork Check only show the last 5 remote versions, include the --all option if you want to see them all
255
+ - Spork will no longer work with Ruby 1.8. If you're on that version, the plugin will bail immediately.
256
+ - Spork now support updating a graphite metric when promote --remote is run
257
+ - Spork now supports alerting using irccat when a cookbook upload or promote --remote happens
258
+ - It will also optionally post a gist of version constraint changes in the above message when a promote --remote happens
259
+ - Added support for default environments to promote to
260
+ - knife-spork gemification thanks to Daniel Schauenberg
261
+
262
+ Bugfixes:
263
+
264
+ - Various bugfixes and tweaks to formatting and log messages
265
+
266
+ ## 0.1.4 (3rd February, 2012)
267
+
268
+ Yanked
269
+
270
+ ## 0.1.3 (3rd February, 2012)
271
+
272
+ Yanked
273
+
274
+ ## 0.1.2 (3rd February, 2012)
275
+
276
+ Yanked
277
+
278
+ ## 0.1.1 (3rd February, 2012)
279
+
280
+ Yanked
281
+
282
+ ## 0.1.0 (January 28, 2012)
283
+
284
+ Initial version.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,35 @@
1
+ KnifeSpork
2
+ ----------
3
+ Author:: Jon Cowie (<jonlives@gmail.com>)
4
+ Copyright:: Copyright (c) 2011 Jon Cowie
5
+ License:: GPL
6
+
7
+ Plugin API
8
+ ----------
9
+ Author:: Seth Vargo (<svargo@customink.com>)
10
+ Copyright:: Copyright (c) 2012 Seth Vargo
11
+ License:: GPL
12
+
13
+ Other
14
+ -----
15
+ spork bump is based on the knife-cookbook-bump plugin by:
16
+ Alalanta (no license specified)
17
+
18
+ With snippets from:
19
+ Author:: Adam Jacob (<adam@opscode.com>)
20
+ Author:: Christopher Walters (<cw@opscode.com>)
21
+ Author:: Nuo Yan (<yan.nuo@gmail.com>)
22
+ Copyright:: Copyright (c) 2009, 2010 Opscode, Inc.
23
+ License:: Apache License, Version 2.0
24
+
25
+ Licensed under the Apache License, Version 2.0 (the "License");
26
+ you may not use this file except in compliance with the License.
27
+ You may obtain a copy of the License at
28
+
29
+ http://www.apache.org/licenses/LICENSE-2.0
30
+
31
+ Unless required by applicable law or agreed to in writing, software
32
+ distributed under the License is distributed on an "AS IS" BASIS,
33
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34
+ See the License for the specific language governing permissions and
35
+ limitations under the License.
@@ -0,0 +1,406 @@
1
+ KnifeSpork
2
+ ===========
3
+ KnifeSpork is a workflow plugin for `Chef::Knife` which helps multiple developers work on the same Chef Server and repository without treading on each other's toes. This plugin was designed around the workflow we have here at Etsy, where several people are working on the Chef repository and Chef Server simultaneously. It contains several functions, documented below:
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/knife-spork.png)](http://badge.fury.io/rb/knife-spork)
6
+
7
+ Installation
8
+ ------------
9
+
10
+ ### Gem Install
11
+ `knife-spork` is available on rubygems. Add the following to your `Gemfile`:
12
+
13
+ ```ruby
14
+ gem 'knife-spork'
15
+ ```
16
+
17
+ or install the gem manually:
18
+
19
+ ```bash
20
+ gem install knife-spork
21
+ ```
22
+
23
+ **Please note**: As of version 1.3.0, knife-spork depends on version 11.0.0 or greater of the chef gem. If you're still using Chef 10, please continue to use knife-spork 1.2.x
24
+ Spork Configuration
25
+ -------------------
26
+ Out of the box, knife spork will work with no configuration. However, you can optionally enable several features to enhance its functionality.
27
+
28
+ KnifeSpork will look for a configuration file in the following locations, in ascending order of precedence:
29
+
30
+ - `config/spork-config.yml`
31
+ - `/etc/spork-config.yml`
32
+ - `~/.chef/spork-config.yml`
33
+
34
+ Anything set in the configuration file in your home directory for example, will override options set in your Chef repository or `/etc`.
35
+
36
+ Below is a sample config file with all supported options and all shipped plugins enabled below, followed by an explanation of each section.
37
+
38
+ ```yaml
39
+ default_environments:
40
+ - development
41
+ - production
42
+ environment_groups:
43
+ qa_group:
44
+ - quality_assurance
45
+ - staging
46
+ test_group:
47
+ - user_testing
48
+ - acceptance_testing
49
+ version_change_threshold: 2
50
+ environment_path: "/home/me/environments"
51
+ role_path: "/home/me/roles"
52
+ custom_plugin_path: "/home/me/spork-plugins"
53
+ always_promote_remote: true
54
+ plugins:
55
+ campfire:
56
+ account: myaccount
57
+ token: a1b2c3d4...
58
+ foodcritic:
59
+ tags: ['any']
60
+ hipchat:
61
+ api_token: ABC123
62
+ rooms:
63
+ - General
64
+ - Web Operations
65
+ notify: true
66
+ color: yellow
67
+ jabber:
68
+ username: YOURUSER
69
+ password: YOURPASSWORD
70
+ nickname: Chef Bot
71
+ server_name: your.jabberserver.com
72
+ server_port: 5222
73
+ rooms:
74
+ - engineering@your.conference.com/spork
75
+ - systems@your.conference.com/spork
76
+ git:
77
+ enabled: true
78
+ irccat:
79
+ server: irccat.mydomain.com
80
+ port: 12345
81
+ gist: "/usr/bin/gist"
82
+ channel: ["chef-annoucements"]
83
+ graphite:
84
+ server: graphite.mydomain.com
85
+ port: 2003
86
+ eventinator:
87
+ url: http://eventinator.mydomain.com/events/oneshot
88
+ ```
89
+
90
+ #### Default Environments
91
+ The `default_environments` directive allows you to specify a default list of environments you want to promote changes to. If this option is configured and you *omit* the environment parameter when promoting KnifeSpork will promote to all environments in this list.
92
+
93
+ #### Environment Groups
94
+ The `environment_groups` directive allows you to specify a list of environments referenced by group names that you want to promote changes to.
95
+
96
+ #### Version Change Threshold
97
+ The `version_change_threshold` directive allows you to customise the threshold used by a safety check in spork promote which will prompt for confirmation if you're promoting a cookbook by more than version_change_threshold versions. This defaults to 2 if not set, ie promoting a cookbook from v1.0.1 to v 1.0.2 will not trip this check, wheras promoting from v1.0.1 to v1.0.3 will.
98
+
99
+ #### Always Promote Remote
100
+ The `always_promote_remote` directive allows you to tell spork promote to always act as if the --remote option had been specified. This will also have the same effect on spork omni. This option should only be used if you're sure you want all changes to be uploaded to the server as soon as you run promote.
101
+
102
+
103
+ #### Environment Path
104
+ The `environment_path` allows you to specify the path to where you store your chef environment json files. If this parameter is not specified, spork will default to using the first element of your cookbook_path, replacing the word "cookbooks" with "environments"
105
+
106
+ #### Role Path
107
+ The `role_path` allows you to specify the path to where you store your chef role json files. If this parameter is not specified, spork will default to using the first element of your cookbook_path, replacing the word "cookbooks" with "roles"
108
+
109
+ #### Custom Plugin Path
110
+ The `custom_plugin_path` allows you to specify an additional directory from which to load knife-spork plugins. If this parameter is not specified or the path set does not exist, only the default plugins shipped with knife-spork will be loaded (if enabled in config)
111
+
112
+
113
+ #### Plugins
114
+ Knife spork supports plugins to allow users to hook it into existing systems such as source control, monitoring and chat systems. Plugins are enabled / disabled by adding / removing their config block from the plugin section of the config file. Any of the default plugins shown above can be disabled by removing their section.
115
+
116
+ For more information on how to develop plugins for spork, please read the [plugins/README.md](plugins/README.md) file.
117
+
118
+ Spork Info
119
+ -----------
120
+ This function is designed to help you see which plugins you currently have loaded, and the current config Hash which knife spork is using.
121
+
122
+ #### Usage
123
+ ```bash
124
+ knife spork info
125
+ ```
126
+
127
+ #### Example
128
+
129
+ ```text
130
+ $ knife spork info
131
+ Config Hash:
132
+ {"plugins"=>{"git"=>{"enabled"=>true}, "irccat"=>{"server"=>"irccat.mydomain.com", "port"=>12345, "gist"=>"usr/bin/gist", "channel"=>["#chef-announce"]}, "graphite"=>{"server"=>"graphite.mydomain.com", "port"=>2003}, "eventinator"=>{"url"=>"http://eventinator.mydomain.com/events/oneshot"}}, "default_environments"=>["development", "production"], "version_change_threshold"=>2, "pplugins"=>{"foodcritic"=>{"fail_tags"=>["style,correctness,test"], "tags"=>["~portability"], "include_rules"=>["config/rules.rb"]}}}
133
+
134
+ Plugins:
135
+ KnifeSpork::Plugins::Campfire: disabled
136
+ KnifeSpork::Plugins::Eventinator: enabled
137
+ KnifeSpork::Plugins::Foodcritic: disabled
138
+ KnifeSpork::Plugins::Git: enabled
139
+ KnifeSpork::Plugins::Graphite: enabled
140
+ KnifeSpork::Plugins::HipChat: disabled
141
+ KnifeSpork::Plugins::Irccat: enabled
142
+ ```
143
+
144
+ Spork Check
145
+ -----------
146
+ This function is designed to help you avoid trampling on other people's cookbook versions, and to make sure that when you come to version your own work it's easy to see what version numbers have already been used and if the one you're using will overwrite anything.
147
+
148
+ #### Usage
149
+ ```bash
150
+ knife spork check COOKBOOK [--all]
151
+ ```
152
+
153
+ By default, spork check only shows the 5 most recent remote cookbook versions. Add the --all option if you want to see everything.
154
+
155
+ #### Example (Checking an Unfrozen Cookbook with version clash)
156
+
157
+ ```text
158
+ $ knife spork check apache2
159
+ Checking versions for cookbook apache2...
160
+
161
+ Local Version:
162
+ 1.1.49
163
+
164
+ Remote Versions: (* indicates frozen)
165
+ *2.0.2
166
+ *2.0.1
167
+ 1.1.49
168
+ *1.1.14
169
+ *1.1.13
170
+
171
+ ERROR: The version 1.1.49 exists on the server and is not frozen. Uploading will overwrite!
172
+ ```
173
+
174
+ #### Example (Checking a Frozen Cookbook with version clash)
175
+
176
+ ```text
177
+ $ knife spork check apache2
178
+ Checking versions for cookbook apache2...
179
+
180
+ Local Version:
181
+ 2.0.2
182
+
183
+ Remote Versions: (* indicates frozen)
184
+ *2.0.2
185
+ *2.0.1
186
+ 1.1.49
187
+ *1.1.14
188
+ *1.1.13
189
+
190
+ WARNING: Your local version (2.0.2) is frozen on the remote server. You'll need to bump before you can upload.
191
+ ````
192
+
193
+ #### Example (No version clashes)
194
+
195
+ ```text
196
+ $ knife spork check apache2
197
+ Checking versions for cookbook apache2...
198
+
199
+ Local Version:
200
+ 2.0.3
201
+
202
+ Remote Versions: (* indicates frozen)
203
+ *2.0.2
204
+ *2.0.1
205
+ 1.1.49
206
+ *1.1.14
207
+ *1.1.13
208
+
209
+ Everything looks good!
210
+ ```
211
+
212
+ Spork Bump
213
+ ----------
214
+ This function lets you easily version your cookbooks without having to manually edit the cookbook's `metadata.rb` file. You can either specify the version level you'd like to bump (`major`, `minor`, or `patch`), or you can manually specify a version number. This might be used if, for example, you want to jump several version numbers in one go and don't want to have to run knife bump once for each number. If no bump level is specified, a patch level bump will be performed.
215
+
216
+ #### Usage
217
+ ```bash
218
+ knife spork bump COOKBOOK [major | minor | patch | manual x.x.x]
219
+ ````
220
+
221
+ #### Example (No patch level specified - defaulting to patch)
222
+ ```text
223
+ $ knife spork bump apache2
224
+ Successfully bumped apache2 to v2.0.4!
225
+ ```
226
+
227
+ #### Example (Bumping patch level)
228
+ ```text
229
+ $ knife spork bump apache2 patch
230
+ Successfully bumped apache2 to v2.0.4!
231
+ ```
232
+
233
+ #### Example (Manually setting version)
234
+ ```text
235
+ $ knife spork bump apache2 manual 1.0.13
236
+ Successfully bumped apache2 to v1.0.13!
237
+ ```
238
+
239
+ Spork Upload
240
+ ------------
241
+ This function works mostly the same as normal `knife cookbook upload COOKBOOK` except that this automatically freezes cookbooks when you upload them.
242
+
243
+ #### Usage
244
+ ```bash
245
+ knife spork upload COOKBOOK
246
+ ```
247
+ #### Example
248
+ ```text
249
+ $ knife spork upload apache2
250
+ Freezing apache2 at 1.0.13...
251
+ Successfully uploaded apache2@1.0.13!
252
+ ```
253
+
254
+ Spork Promote
255
+ -------------
256
+ This function lets you easily set a version constraint in an environment or group of environments for a particular cookbook. By default it will set the version constraint to whatever the local version of the specified cookbook is. Optionally, you can include a `--version` option which will set the version constraint for the specified cookbook to whatever version number you provide. You might want to use this if, for example, you pushed a version constraint for a cookbook version you don't want your nodes to use anymore, so you want to "roll back" the environment to a previous version. You can also specify the `--remote` option if you'd like to automatically upload your changed local environment file to the server.
257
+
258
+ If you don't specify an environment or environment group, the default_environments config directive will be used if set.
259
+
260
+ #### Usage
261
+
262
+ ```bash
263
+ knife spork promote [ENVIRONMENT OR ENVIRONMENT GROUP NAME] COOKBOOK [--version, --remote]
264
+ ```
265
+
266
+ #### Example (Using local cookbook version number)
267
+
268
+ ```text
269
+ $ knife spork promote my_environment apache2 --remote
270
+ Adding version constraint apache2 = 1.0.13
271
+ Saving changes to my_environment.json
272
+ Uploading my_environment to Chef Server
273
+ Promotion complete!
274
+ ```
275
+
276
+ #### Example (Using manual version)
277
+ ```text
278
+ $ knife spork promote my_environment apache2 -v 2.0.2
279
+ Adding version constraint apache2 = 2.0.2
280
+ Saving changes to my_environment.json
281
+ Promotion complete. Don't forget to upload your changed my_environment to Chef Server
282
+ ```
283
+
284
+ Spork Omni
285
+ -------------
286
+ Omni lets you combine one of the most common combinations of spork commands (bump, upload & promote or promote --remote) - into one handy shortcut.
287
+
288
+ As omni is designed for use only in those cases where you want to perform all three of bump, upload and promote at the same time it supports a limited subset of the command line options supported by the individual bump, upload and promote commands.
289
+
290
+ If you run omni with no extra options, it will default to performing a ```patch``` level bump, and promote locally to the environments listed in the ```default_environments``` variable in your spork configuration file.
291
+
292
+ Alternatively, you can specify any of the following options:
293
+
294
+ ```--cookbook-path PATH:PATH```: A colon-separated path to look for cookbooks in
295
+
296
+ ```--include-dependencies```: Also upload cookbook dependencies during the upload step
297
+
298
+ ```--bump-level [major|minor|patch]```: Version level to bump the cookbook (defaults to patch)
299
+
300
+ ```--environment ENVIRONMENT```: Environment to promote the cookbook to',
301
+
302
+ ```--remote```: Make omni perform a promote --remote instead of a local promote',
303
+
304
+ #### Usage
305
+
306
+ ```bash
307
+ knife spork omni COOKBOOK [--bump-level, --cookbook-path, --include-dependencies, --environment, --remote]
308
+ ```
309
+
310
+ #### Example (default options, default_environments set to development and production)
311
+
312
+ ```text
313
+ $ knife spork omni apache2
314
+ OMNI: Bumping apache2
315
+ Successfully bumped apache2 to v0.3.99!
316
+
317
+ OMNI: Uploading apache2
318
+ Freezing apache2 at 0.3.99...
319
+ Successfully uploaded apache2@0.3.99!
320
+
321
+ OMNI: Promoting apache2
322
+ Adding version constraint apache2 = 0.3.99
323
+ Saving changes to development.json
324
+ Promotion complete. Don't forget to upload your changed development.json to Chef Server
325
+ Adding version constraint apache2 = 0.3.99
326
+ Saving changes to production.json
327
+ Promotion complete. Don't forget to upload your changed production.json to Chef Server
328
+ ```
329
+
330
+ #### Example (default options, default_environments set to development and production, promote --remote)
331
+
332
+ ```text
333
+ $ knife spork omni apache2 --remote
334
+ OMNI: Bumping apache2
335
+ Successfully bumped apache2 to v0.3.99!
336
+
337
+ OMNI: Uploading apache2
338
+ Freezing apache2 at 0.3.99...
339
+ Successfully uploaded apache2@0.3.99!
340
+
341
+ OMNI: Promoting apache2
342
+ Adding version constraint apache2 = 0.3.99
343
+ Saving changes to development.json
344
+ Uploading development.json to Chef Server
345
+ Promotion complete at 2013-08-08 11:43:12 +0100!
346
+ Adding version constraint apache2 = 0.3.99
347
+ Saving changes to production.json
348
+ Uploading production.json to Chef Server
349
+ Promotion complete at 2013-08-08 11:43:12 +0100!
350
+ ```
351
+
352
+ #### Example (Specifying patch level and environment)
353
+ ```text
354
+ $ knife spork omni apache2 -l minor -e development
355
+ OMNI: Bumping apache2
356
+ Successfully bumped apache2 to v0.4.0!
357
+
358
+ OMNI: Uploading apache2
359
+ Freezing apache2 at 0.4.0...
360
+ Successfully uploaded apache2@0.4.0!
361
+
362
+ OMNI: Promoting apache2
363
+ Adding version constraint apache2 = 0.4.0
364
+ Saving changes to development.json
365
+ Promotion complete. Don't forget to upload your changed development.json to Chef Server
366
+ ```
367
+
368
+ Spork Node / Role / Databag Commands
369
+ -------------
370
+
371
+ Knife spork contains "wrappers" around several stock knife commands for changing nodes, roles, environments and databags. These commands work exactly as in the original knife, with the addition of being wrapped in Spork's plugin API. This means that for example, when you upload a role using spork you will see an IRC message containing details, and a gist of the role change.
372
+
373
+ The following ```data bag``` commands are provided in knife-spork:
374
+ ```
375
+ knife spork data bag create
376
+ knife spork data bag delete
377
+ knife spork data bag edit
378
+ knife spork data bag from file
379
+ ```
380
+
381
+ The following ```node``` commands are provided in knife-spork:
382
+ ```
383
+ knife spork node create
384
+ knife spork node delete
385
+ knife spork node edit
386
+ knife spork node from file
387
+ knife spork node run_list add
388
+ knife spork node run_list remove
389
+ knife spork node run_list set
390
+ ```
391
+
392
+ The following ```role``` commands are provided in knife-spork:
393
+ ```
394
+ knife spork role create
395
+ knife spork role delete
396
+ knife spork role edit
397
+ knife spork role from file
398
+ ```
399
+
400
+ The following ```environment``` commands are provided in knife-spork:
401
+ ```
402
+ knife spork environment create
403
+ knife spork environment delete
404
+ knife spork environment edit
405
+ knife spork environment from file
406
+ ```