Skip to content

Commit

Permalink
updated README, reworked commit message, clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
chazzly committed Apr 23, 2015
1 parent e93357d commit a580e17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ custom_plugin_path: "/home/me/spork-plugins"
always_promote_remote: true
skip_berkshelf: false
role_match_file_name: true
bump_config: true
bump_comment: true
json_options:
indent: " "
plugins:
Expand Down Expand Up @@ -87,6 +87,7 @@ plugins:
branch: some_branch
bump_tag: false
bump_commit: false
bump_comment: false
irccat:
server: irccat.mydomain.com
port: 12345
Expand Down Expand Up @@ -138,8 +139,8 @@ The `always_promote_remote` directive allows you to tell spork promote to always
The `skip_berkshelf` directive is a temporary flag added in [#138](https://github.com/jonlives/knife-spork/issues/138) to allow Berkshelf functionality to be optionally bypassed until Berkshelf 3 support has been added to knife-spork per [#85](https://github.com/jonlives/knife-spork/issues/85). It simply removed the :Berkshelf constant from the namespace used by knife-spork.

#### Bump Comment
The 'bump_comment` directive tells spork to always prompt the user for a comment reguarding the changes to this version of the cookbook. This comment will be appended to the CHANGELOG.md file along with the new version # and the user name. This can also be done with the "--bump_comment" on the command line.
NOTE: See bump_tag & bump_commit under the Git plug-in
The 'bump_comment` directive tells spork to prompt the user for a comment reguarding the changes to this version of the cookbook. This comment will be appended to the CHANGELOG.md file along with the new version # and the user name. This can also be done with the "--bump_comment" on the command line.
NOTE: The bump_comment & bump_commit directives under the Git plug-in, allow spork to take this comment and use it as a git commit message.

#### 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
Expand Down Expand Up @@ -266,6 +267,7 @@ Spork Bump
This function lets you easily version your cookbooks without having to manually edit the cookbook's `metadata.rb` & `CHANGELOG.md` files. 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.

Spork Bump can also be configured promt the user for a comment reguarding thier change. This comment will be appended to the CHANGELOG.md file along with the new version, and the current username. This is done either by using the '--bump_comment' option on the command line or by setting the bump_comment: directive to true.
NOTE: The bump_comment & bump_commit directives under the Git plug-in, allow spork to take this comment and use it as a git commit message.

#### Usage
```bash
Expand Down
10 changes: 0 additions & 10 deletions lib/chef/knife/spork-bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ def run
self.config = Chef::Config.merge!(config)
config[:cookbook_path] ||= Chef::Config[:cookbook_path]
config[:bump_comment] ||= spork_config.bump_comment
config[:bump_tag] ||= spork_config.bump_tag
config[:bump_commit] ||= spork_config.bump_commit

if @name_args.empty?
show_usage
Expand Down Expand Up @@ -109,14 +107,6 @@ def bump
new_contents = File.read(metadata_file).gsub(/(version\s+['"])[0-9\.]+(['"])/, "\\1#{new_version}\\2")
File.open(metadata_file, 'w'){ |f| f.write(new_contents) }

if config[:bump_tag]
ui.info "Bump Tag is enabled"
end

if config[:bump_commit]
ui.info "Bump Commit is enabled"
end

if config[:bump_comment]
changelog_file = "#{@cookbook.root_dir}/CHANGELOG.md"
ui.info "Enter Change Log comment, then press Ctrl-D: "
Expand Down
13 changes: 2 additions & 11 deletions lib/knife-spork/plugins/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def after_bump
}
file = File.open change_file
change_comment=[*file][last_comment_line + 1]
git_commit(change_comment)
git_commit('.', "[Knife-Spork] #{change_comment}")
else
git_commit("Bumping #{cookbook.name} to #{new_version}")
git_commit('.',"[Knife-Spork] Bumping #{cookbook.name} to #{new_version}")
end
end
end
Expand All @@ -74,7 +74,6 @@ def after_promote_local
else
"master"
end

git_commit(environment_path, "promote #{cookbooks.collect{ |c| "#{c.name}@#{c.version}" }.join(",")} to #{environments.join(",")}")
git_push(branch)
end
Expand All @@ -88,14 +87,6 @@ def bump_tag
config.bump_tag || false
end

def bump_commit
config.bump_commit || false
end

def bump_tag
config.bump_tag || false
end

private
def git
safe_require 'git'
Expand Down

0 comments on commit a580e17

Please sign in to comment.