README.md in knife-spork-1.3.2 vs README.md in knife-spork-1.3.3

- old
+ new

@@ -45,14 +45,17 @@ - staging test_group: - user_testing - acceptance_testing version_change_threshold: 2 +preserve_constraint_operators: true environment_path: "/home/me/environments" role_path: "/home/me/roles" custom_plugin_path: "/home/me/spork-plugins" always_promote_remote: true +json_options: + indent: " " plugins: campfire: account: myaccount token: a1b2c3d4... foodcritic: @@ -94,13 +97,18 @@ The `environment_groups` directive allows you to specify a list of environments referenced by group names that you want to promote changes to. #### Version Change Threshold 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. +#### Preserve Constraint Operators +The `preserve_constraint_operators` directive causes spork promote to preserve existing version constraint operators in your environment files, only updating the version number. This directive is disabled by default, which causes spork to always use the `=` constraint. + #### Always Promote Remote 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. +#### JSON Options +The `json_options` directive allows you to tell spork to pass options to [pretty_generate](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/json/rdoc/JSON.html#method-i-pretty_generate) to control the format of the resulting json #### 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 @@ -361,9 +369,62 @@ 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 Environnent Check +------------- +Environment check provides the ability to validate a local chef environment file is locked to versions that actually exist on the chef server. Running this check prior to uploading your environment files is recommended as it can prevent your chef server from becoming unresponsive due to a version constraint that will never be valid. + +If you run environment check with no options it will collect all invalid cookbook versions before reporting a failure. + +Alternatively, you can specify any of the following options: + +```-f, --fatal```: Quit on first invalid constraint located + +#### Usage + +```bash +knife spork environment check ENVIRONMENT (options) +``` + +#### Example of a passing chef environment check with no options + +```text +$ knife spork environment check production + +Checking constraints for environment: production +Environment production looks good +``` + +#### Example of multiple invalid cookbooks with no options + +```text +$ knife spork environment check production + +Checking constraints for environment: production +ERROR: mysql@10.2.0 does not exist on Chef Server! Upload the cookbook first by running: + + knife spork upload mysql + +ERROR: rbenv@10.7.1 does not exist on Chef Server! Upload the cookbook first by running: + + knife spork upload rbenv + +FATAL: Environment production has constraints that point to non existent cookbook versions. +``` + +#### Example of running with the --fatal flag with the same invalid cookbooks from previous example + +```text +$ knife spork environment check production + +Checking constraints for environment: production +FATAL: mysql@10.2.0 does not exist on Chef Server! Upload the cookbook first by running: + + knife spork upload mysql ``` Spork Node / Role / Databag Commands -------------