README.md in knife-spork-1.2.2 vs README.md in knife-spork-1.3.0
- old
+ new
@@ -2,11 +2,12 @@
===========
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:
Installation
------------
-### Gem Install (recommended)
+
+### Gem Install
`knife-spork` is available on rubygems. Add the following to your `Gemfile`:
```ruby
gem 'knife-spork'
```
@@ -15,13 +16,11 @@
```bash
gem install knife-spork
```
-### Plugin Install
-Copy spork-* script from lib/chef/knife/spork-*.rb to your ~/.chef/plugins/knife directory.
-
+**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
Spork Configuration
-------------------
Out of the box, knife spork will work with no configuration. However, you can optionally enable several features to enhance its functionality.
KnifeSpork will look for a configuration file in the following locations, in ascending order of precedence:
@@ -45,14 +44,18 @@
test_group:
- user_testing
- acceptance_testing
version_change_threshold: 2
environment_path: "/home/me/environments"
+role_path: "/home/me/roles"
+custom_plugin_path: "/home/me/spork-plugins"
plugins:
campfire:
account: myaccount
token: a1b2c3d4...
+ foodcritic:
+ tags: ['any']
hipchat:
api_token: ABC123
rooms:
- General
- Web Operations
@@ -91,10 +94,17 @@
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.
#### Environment Path
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"
+#### Role Path
+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"
+
+#### Custom Plugin Path
+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)
+
+
#### Plugins
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.
For more information on how to develop plugins for spork, please read the [plugins/README.md](plugins/README.md) file.
@@ -196,11 +206,11 @@
----------
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.
#### Usage
```bash
-knife spork bump COOKBOOK [MAJOR | MINOR | PATCH | MANUAL x.x.x]
+knife spork bump COOKBOOK [major | minor | patch | manual x.x.x]
````
#### Example (No patch level specified - defaulting to patch)
```text
$ knife spork bump apache2
@@ -261,5 +271,121 @@
$ knife spork promote my_environment apache2 -v 2.0.2
Adding version constraint apache2 = 2.0.2
Saving changes to my_environment.json
Promotion complete. Don't forget to upload your changed my_environment to Chef Server
```
+
+Spork Omni
+-------------
+Omni lets you combine one of the most common combinations of spork commands (bump, upload & promote or promote --remote) - into one handy shortcut.
+
+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.
+
+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.
+
+Alternatively, you can specify any of the following options:
+
+```--cookbook-path PATH:PATH```: A colon-separated path to look for cookbooks in
+
+```--include-dependencies```: Also upload cookbook dependencies during the upload step
+
+```--bump-level [major|minor|patch]```: Version level to bump the cookbook (defaults to patch)
+
+```--environment ENVIRONMENT```: Environment to promote the cookbook to',
+
+```--remote```: Make omni perform a promote --remote instead of a local promote',
+
+#### Usage
+
+```bash
+knife spork omni COOKBOOK [--bump-level, --cookbook-path, --include-dependencies, --environment, --remote]
+```
+
+#### Example (default options, default_environments set to development and production)
+
+```text
+$ knife spork omni apache2
+OMNI: Bumping apache2
+Successfully bumped apache2 to v0.3.99!
+
+OMNI: Uploading apache2
+Freezing apache2 at 0.3.99...
+Successfully uploaded apache2@0.3.99!
+
+OMNI: Promoting apache2
+Adding version constraint apache2 = 0.3.99
+Saving changes to development.json
+Promotion complete. Don't forget to upload your changed development.json to Chef Server
+Adding version constraint apache2 = 0.3.99
+Saving changes to production.json
+Promotion complete. Don't forget to upload your changed production.json to Chef Server
+```
+
+#### Example (default options, default_environments set to development and production, promote --remote)
+
+```text
+$ knife spork omni apache2 --remote
+OMNI: Bumping apache2
+Successfully bumped apache2 to v0.3.99!
+
+OMNI: Uploading apache2
+Freezing apache2 at 0.3.99...
+Successfully uploaded apache2@0.3.99!
+
+OMNI: Promoting apache2
+Adding version constraint apache2 = 0.3.99
+Saving changes to development.json
+Uploading development.json to Chef Server
+Promotion complete at 2013-08-08 11:43:12 +0100!
+Adding version constraint apache2 = 0.3.99
+Saving changes to production.json
+Uploading production.json to Chef Server
+Promotion complete at 2013-08-08 11:43:12 +0100!
+```
+
+#### Example (Specifying patch level and environment)
+```text
+$ knife spork omni apache2 -l minor -e development
+OMNI: Bumping apache2
+Successfully bumped apache2 to v0.4.0!
+
+OMNI: Uploading apache2
+Freezing apache2 at 0.4.0...
+Successfully uploaded apache2@0.4.0!
+
+OMNI: Promoting apache2
+Adding version constraint apache2 = 0.4.0
+Saving changes to development.json
+Promotion complete. Don't forget to upload your changed development.json to Chef Server
+```
+
+Spork Node / Role / Databag Commands
+-------------
+
+Knife spork contains "wrappers" around several stock knife commands for changing nodes, roles, 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.
+
+The following ```data bag``` commands are provided in knife-spork:
+```
+knife spork data bag create
+knife spork data bag delete
+knife spork data bag edit
+knife spork data bag from file
+```
+
+The following ```node``` commands are provided in knife-spork:
+```
+knife spork node create
+knife spork node delete
+knife spork node edit
+knife spork node from file
+knife spork node run_list add
+knife spork node run_list remove
+knife spork node run_list set
+```
+
+The following ```role``` commands are provided in knife-spork:
+```
+knife spork role create
+knife spork role delete
+knife spork role edit
+knife spork role from file
+```
\ No newline at end of file