Skip to content

Commit

Permalink
Merge pull request #23 from chef/0.9.6
Browse files Browse the repository at this point in the history
0.9.6
  • Loading branch information
chris-rock committed Dec 11, 2015
2 parents d5d4b07 + cb296a6 commit 4686f69
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 4 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# Change Log

## [Unreleased](https://github.com/chef/kitchen-inspec/tree/HEAD)

[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.9.0...HEAD)
## [0.9.6](https://github.com/chef/kitchen-inspec/tree/0.9.6) (2015-12-11)
[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.9.0...0.9.6)

**Implemented enhancements:**

- add changelog [\#18](https://github.com/chef/kitchen-inspec/pull/18) ([chris-rock](https://github.com/chris-rock))
- support test suite helpers [\#12](https://github.com/chef/kitchen-inspec/pull/12) ([schisamo](https://github.com/schisamo))
- Fix typo in README [\#8](https://github.com/chef/kitchen-inspec/pull/8) ([englishm](https://github.com/englishm))
- Gem [\#7](https://github.com/chef/kitchen-inspec/pull/7) ([chris-rock](https://github.com/chris-rock))

**Fixed bugs:**

- tests fail with inspec 0.9.5 [\#19](https://github.com/chef/kitchen-inspec/issues/19)
- Fix tests and activate linting for CI [\#20](https://github.com/chef/kitchen-inspec/pull/20) ([srenatus](https://github.com/srenatus))
- raise ActionFailed when inspec returns other than 0. [\#13](https://github.com/chef/kitchen-inspec/pull/13) ([sawanoboly](https://github.com/sawanoboly))

**Closed issues:**

- ReadMe 'example here' dead link / 404 [\#21](https://github.com/chef/kitchen-inspec/issues/21)

**Merged pull requests:**

- fix readme [\#22](https://github.com/chef/kitchen-inspec/pull/22) ([srenatus](https://github.com/srenatus))

## [v0.9.0](https://github.com/chef/kitchen-inspec/tree/v0.9.0) (2015-11-03)
**Implemented enhancements:**

Expand Down
77 changes: 77 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,80 @@ begin
rescue LoadError
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
end

# Print the current version of this gem or update it.
#
# @param [Type] target the new version you want to set, or nil if you only want to show
def kitchen_inspec_version(target = nil)
path = 'lib/kitchen/verifier/inspec_version.rb'
require_relative path.sub(/.rb$/, '')

nu_version = target.nil? ? '' : " -> #{target}"
puts "Kitchen-inspec: #{Kitchen::Verifier::INSPEC_VERSION}#{nu_version}"

unless target.nil?
raw = File.read(path)
nu = raw.sub(/INSPEC_VERSION.*/, "INSPEC_VERSION = '#{target}'")
File.write(path, nu)
load(path)
end
end

# Check if a command is available
#
# @param [Type] x the command you are interested in
# @param [Type] msg the message to display if the command is missing
def require_command(x, msg = nil)
return if system("command -v #{x} || exit 1")
msg ||= 'Please install it first!'
puts "\033[31;1mCan't find command #{x.inspect}. #{msg}\033[0m"
exit 1
end

# Check if a required environment variable has been set
#
# @param [String] x the variable you are interested in
# @param [String] msg the message you want to display if the variable is missing
def require_env(x, msg = nil)
exists = `env | grep "^#{x}="`
return unless exists.empty?
puts "\033[31;1mCan't find environment variable #{x.inspect}. #{msg}\033[0m"
exit 1
end

# Check the requirements for running an update of this repository.
def check_update_requirements
require_command 'git'
require_command 'github_changelog_generator', "\n"\
"For more information on how to install it see:\n"\
" https://github.com/skywinder/github-changelog-generator\n"
require_env 'CHANGELOG_GITHUB_TOKEN', "\n"\
"Please configure this token to make sure you can run all commands\n"\
"against GitHub.\n\n"\
"See github_changelog_generator homepage for more information:\n"\
" https://github.com/skywinder/github-changelog-generator\n"
end

# Show the current version of this gem.
desc 'Show the version of this gem'
task :version do
kitchen_inspec_version
end

desc 'Generate the changelog'
task :changelog do
require_relative 'lib/kitchen/verifier/inspec_version'
system "github_changelog_generator -u chef -p kitchen-inspec --future-release #{Kitchen::Verifier::INSPEC_VERSION}"
end

# Update the version of this gem and create an updated
# changelog. It covers everything short of actually releasing
# the gem.
desc 'Bump the version of this gem'
task :bump_version, [:version] do |_, args|
v = args[:version] || ENV['to']
fail "You must specify a target version! rake release[1.2.3]" if v.empty?
check_update_requirements
kitchen_inspec_version(v)
Rake::Task['changelog'].invoke
end
2 changes: 1 addition & 1 deletion lib/kitchen/verifier/inspec_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
module Kitchen
module Verifier
# Version string for InSpec Kitchen verifier
INSPEC_VERSION = '0.9.0'
INSPEC_VERSION = '0.9.6'
end
end

0 comments on commit 4686f69

Please sign in to comment.