Skip to content

Commit

Permalink
Merge branch 'supermarket-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
mthssdrbrg committed Mar 24, 2016
2 parents ea4f78b + 9e5e8fb commit ce7abbe
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 28 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

group :development do
gem 'rake'
gem 'stove'
end

group :test do
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ GEM
pry (~> 0.9)
rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1)
chef-api (0.5.0)
logify (~> 0.1)
mime-types
chef-zero (2.0.2)
hashie (~> 2.0)
json
Expand Down Expand Up @@ -95,6 +98,7 @@ GEM
test-kitchen (>= 1.0.0)
kitchen-vagrant (0.18.0)
test-kitchen (~> 1.4)
logify (0.2.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.1)
Expand Down Expand Up @@ -179,6 +183,9 @@ GEM
solve (1.2.0)
dep_selector (~> 1.0)
semverse (~> 1.1)
stove (3.2.8)
chef-api (~> 0.5)
logify (~> 0.2)
systemu (2.5.2)
test-kitchen (1.4.2)
mixlib-shellout (>= 1.2, < 3.0)
Expand Down Expand Up @@ -207,6 +214,7 @@ DEPENDENCIES
kitchen-docker
kitchen-vagrant
rake
stove
test-kitchen

BUNDLED WITH
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
[![Build Status](https://travis-ci.org/mthssdrbrg/kafka-cookbook.svg?branch=master)](https://travis-ci.org/mthssdrbrg/kafka-cookbook)
[![GitHub Release](https://img.shields.io/github/release/mthssdrbrg/kafka-cookbook.svg)]()

> Note: if you're reading this on Supermarket, version `< 2` refers to [Webtrends/kafka](https://github.com/Webtrends/kafka)
> cookbook while version `>= 2` refers to [mthssdrbrg/kafka-cookbook](https://github.com/mthssdrbrg/kafka-cookbook).
Installs and configures Kafka `>= v0.8.1`.

Based on the Kafka cookbook released by WebTrends (thanks!), but with a few
Initially based on the Kafka cookbook released by Webtrends (thanks!), but with a few
notable differences:

* does not depend on runit cookbook.
Expand Down
45 changes: 18 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

require 'rspec/core/rake_task'
require 'foodcritic'
require 'tmpdir'
require 'stove'
require 'stove/rake_task'

RSpec::Core::RakeTask.new(:spec)
FoodCritic::Rake::LintTask.new
Expand All @@ -15,38 +16,28 @@ end

desc 'Package the latest version as a .tar.gz archive'
task :package => :test do
contents = Dir.glob('*')
contents.reject! { |path| path.start_with?('.') }
contents.reject! { |path| %w[test spec gemfiles pkg vendor vagrantfiles].include?(path) }
contents.select! { |path| File.directory?(path) }
contents << 'metadata.rb'
contents << 'README.md'

version = %x(git tag -l | tail -1).strip
cookbook = Stove::Cookbook.new(Dir.pwd)
version = cookbook.tag_version
release_name = %(kafka-cookbook-#{version})
archive = %(#{release_name}.tar.gz)
current_directory = File.expand_path('..', __FILE__)

unless File.exist?(archive)
Dir.mktmpdir do |sandbox_path|
File.join(sandbox_path, release_name).tap do |cbk|
Dir.mkdir(cbk)
FileUtils.cp_r(contents, cbk)
end
archive_path = ::File.join('pkg', sprintf('kafka-cookbook-%s.tar.gz', version))

Dir.chdir(sandbox_path) do
%x(tar -czf #{archive} #{release_name})
FileUtils.mv(archive, current_directory)
end
end

puts %(Created archive of #{version} as #{archive})
else
puts %(#{archive} already exist, exiting...)
if File.exist?(archive_path)
puts %(#{archive_path} already exist, exiting...)
exit(1)
else
packager = Stove::Packager.new(cookbook, false)
File.open(archive_path, 'wb') do |f|
f.write(packager.tarball)
end
puts %(Created archive of #{version} as #{archive_path})
end
end

Stove::RakeTask.new do |t|
t.stove_opts = %w[--no-git]
t.log_level = :debug
end

class KitchenTask
attr_reader :output, :duration

Expand Down
1 change: 1 addition & 0 deletions gemfiles/chef-11.10.4/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

group :test do
gem 'rake'
gem 'stove'
gem 'foodcritic', '< 5'
gem 'berkshelf', '< 4'
gem 'chef', '= 11.10.4'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/chef-11.10.4/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ GEM
puma (~> 1.6)
rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1)
chef-api (0.5.0)
logify (~> 0.1)
mime-types
chef-zero (1.7.3)
hashie (~> 2.0)
json
Expand Down Expand Up @@ -89,6 +92,7 @@ GEM
hitimes (1.2.1)
ipaddress (0.8.0)
json (1.8.1)
logify (0.2.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.1)
Expand Down Expand Up @@ -168,6 +172,9 @@ GEM
solve (1.2.0)
dep_selector (~> 1.0)
semverse (~> 1.1)
stove (3.2.8)
chef-api (~> 0.5)
logify (~> 0.2)
systemu (2.5.2)
thor (0.19.1)
timers (3.0.1)
Expand All @@ -189,6 +196,7 @@ DEPENDENCIES
foodcritic (< 5)
rake
rspec (= 2.14.1)
stove

BUNDLED WITH
1.10.6
1 change: 1 addition & 0 deletions gemfiles/chef-11.4.4/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

group :test do
gem 'rake'
gem 'stove'
gem 'foodcritic', '< 5'
gem 'berkshelf', '< 4'
gem 'chef', '= 11.4.4'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/chef-11.4.4/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ GEM
ohai (>= 0.6.0)
rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1)
chef-api (0.5.0)
logify (~> 0.1)
mime-types
chefspec (3.4.0)
chef (~> 11.0)
fauxhai (~> 2.0)
Expand Down Expand Up @@ -77,6 +80,7 @@ GEM
hitimes (1.2.1)
ipaddress (0.8.0)
json (1.7.7)
logify (0.2.0)
mime-types (1.25.1)
mini_portile (0.6.1)
minitar (0.5.4)
Expand Down Expand Up @@ -147,6 +151,9 @@ GEM
solve (1.2.0)
dep_selector (~> 1.0)
semverse (~> 1.1)
stove (3.2.8)
chef-api (~> 0.5)
logify (~> 0.2)
systemu (2.5.2)
thor (0.19.1)
timers (3.0.1)
Expand All @@ -168,6 +175,7 @@ DEPENDENCIES
foodcritic (< 5)
rake
rspec (= 2.14.1)
stove

BUNDLED WITH
1.10.6
1 change: 1 addition & 0 deletions gemfiles/chef-11.6.2/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

group :test do
gem 'rake'
gem 'stove'
gem 'foodcritic', '< 5'
gem 'berkshelf', '< 4'
gem 'chef', '= 11.6.2'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/chef-11.6.2/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ GEM
ohai (>= 0.6.0, < 7.0.0)
rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1)
chef-api (0.5.0)
logify (~> 0.1)
mime-types
chefspec (3.4.0)
chef (~> 11.0)
fauxhai (~> 2.0)
Expand Down Expand Up @@ -77,6 +80,7 @@ GEM
hitimes (1.2.1)
ipaddress (0.8.0)
json (1.7.7)
logify (0.2.0)
mime-types (1.25.1)
mini_portile (0.6.1)
minitar (0.5.4)
Expand Down Expand Up @@ -146,6 +150,9 @@ GEM
solve (1.2.0)
dep_selector (~> 1.0)
semverse (~> 1.1)
stove (3.2.8)
chef-api (~> 0.5)
logify (~> 0.2)
systemu (2.5.2)
thor (0.19.1)
timers (3.0.1)
Expand All @@ -167,6 +174,7 @@ DEPENDENCIES
foodcritic (< 5)
rake
rspec (= 2.14.1)
stove

BUNDLED WITH
1.10.6
1 change: 1 addition & 0 deletions gemfiles/chef-11.8.2/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source 'https://rubygems.org'

group :test do
gem 'rake'
gem 'stove'
gem 'foodcritic', '< 5'
gem 'berkshelf', '< 4'
gem 'chef', '= 11.8.2'
Expand Down
8 changes: 8 additions & 0 deletions gemfiles/chef-11.8.2/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ GEM
puma (~> 1.6)
rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1)
chef-api (0.5.0)
logify (~> 0.1)
mime-types
chef-zero (1.7.3)
hashie (~> 2.0)
json
Expand Down Expand Up @@ -89,6 +92,7 @@ GEM
hitimes (1.2.1)
ipaddress (0.8.0)
json (1.7.7)
logify (0.2.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.1)
Expand Down Expand Up @@ -168,6 +172,9 @@ GEM
solve (1.2.0)
dep_selector (~> 1.0)
semverse (~> 1.1)
stove (3.2.8)
chef-api (~> 0.5)
logify (~> 0.2)
systemu (2.5.2)
thor (0.19.1)
timers (3.0.1)
Expand All @@ -189,6 +196,7 @@ DEPENDENCIES
foodcritic (< 5)
rake
rspec (= 2.14.1)
stove

BUNDLED WITH
1.10.6

0 comments on commit ce7abbe

Please sign in to comment.