kitchen-cabinet 1.2.1.dev → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -1
- data/README.md +17 -36
- data/bin/cabinet +9 -2
- data/kitchen-cabinet.gemspec +1 -1
- data/lib/kitchen-cabinet/cabinet.rb +8 -4
- data/lib/kitchen-cabinet/templates/Gemfile.eruby +2 -1
- data/lib/kitchen-cabinet/templates/Rakefile.eruby +33 -0
- data/lib/kitchen-cabinet/templates/chefignore.eruby +1 -0
- data/lib/kitchen-cabinet/templates/chefspec/default_spec.rb.eruby +1 -1
- data/lib/kitchen-cabinet/templates/chefspec/spec_helper.rb.eruby +1 -1
- data/lib/kitchen-cabinet/templates/serverspec/default_spec.rb.eruby +1 -1
- data/lib/kitchen-cabinet/templates/serverspec/spec_helper.rb.eruby +1 -1
- data/lib/kitchen-cabinet/update.rb +1 -1
- metadata +4 -4
- data/lib/kitchen-cabinet/templates/Strainerfile.eruby +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99aea26399fc3f69deb9108743f3dee9e385ca89
|
4
|
+
data.tar.gz: f10a08c659ec3b682e33b4ffffb10d0e10fe4df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d143919033ca700ee42de22ad8123eea75743f94713684d3966b7e4251563345b02bbbcbd924177ccbd4471877bb4b852b592fe8a73de4f65a8b5a2c6b30164e
|
7
|
+
data.tar.gz: e55c4b8115dd3640a18686cbb41e115cfe4bc43f12a7e639dca22c3d1eefca355046a1443f9e33da98291eb10a17ba3455f76b8106af1f62f97de6b7a247b173
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ About
|
|
7
7
|
|
8
8
|
Inspiration for this gem was taken from [meez](https://github.com/paulczar/meez). It creates an opinionated cookbook complete with testing suites.
|
9
9
|
|
10
|
-
Once `cabinet` has finished running, you will have a new cookbook complete with an initialized git repo, chefspec, serverspec,
|
10
|
+
Once `cabinet` has finished running, you will have a new cookbook complete with an initialized git repo, chefspec, serverspec, test-kitchen, guard (with notifications via inotify/fsevent/terminal-notifier), rubocop, foodcritic, berkshelf, and stove.
|
11
11
|
|
12
12
|
It will automatically create a Gemfile for you with different groups set up for development, testing, etc:
|
13
13
|
|
@@ -34,7 +34,7 @@ group :release do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
group :development do
|
37
|
-
gem '
|
37
|
+
gem 'rake, '~> 10.1'
|
38
38
|
gem 'serverspec', '~> 0.14.2'
|
39
39
|
gem 'guard', '~> 1.8'
|
40
40
|
gem 'guard-rubocop', '~> 0.2'
|
@@ -72,22 +72,21 @@ Options
|
|
72
72
|
### Example
|
73
73
|
|
74
74
|
`````` bash
|
75
|
-
➜ ~ cabinet --cookbook-path ~/Desktop -C Taylor Price -I apachev2 -m tprice@onehealth.com test
|
75
|
+
➜ ~ cabinet --cookbook-path ~/Desktop -C Taylor Price -I apachev2 -m tprice@onehealth.com test
|
76
76
|
* Initializing chef
|
77
|
-
** Creating cookbook test
|
78
|
-
** Creating README for cookbook: test
|
79
|
-
** Creating CHANGELOG for cookbook: test
|
80
|
-
** Creating metadata for cookbook: test
|
77
|
+
** Creating cookbook test
|
78
|
+
** Creating README for cookbook: test
|
79
|
+
** Creating CHANGELOG for cookbook: test
|
80
|
+
** Creating metadata for cookbook: test
|
81
81
|
Rewriting metadata.rb
|
82
82
|
Rewriting recipes/default.rb
|
83
|
-
* Initializing knife
|
84
83
|
* Initializing git
|
85
84
|
* Initializing berkshelf
|
86
|
-
create Desktop/test
|
87
|
-
create Desktop/test
|
88
|
-
create Desktop/test
|
89
|
-
run git init from "
|
90
|
-
create Desktop/test
|
85
|
+
create /Users/tprice/Desktop/test/Berksfile
|
86
|
+
create /Users/tprice/Desktop/test/Thorfile
|
87
|
+
create /Users/tprice/Desktop/test/.gitignore
|
88
|
+
run git init from "/Users/tprice/Desktop/test"
|
89
|
+
create /Users/tprice/Desktop/test/Gemfile
|
91
90
|
* Initializing kitchen
|
92
91
|
create .kitchen.yml
|
93
92
|
append Thorfile
|
@@ -95,34 +94,16 @@ Options
|
|
95
94
|
append Gemfile
|
96
95
|
append Gemfile
|
97
96
|
You must run `bundle install' to fetch any new gems.
|
98
|
-
* Initializing guard
|
99
97
|
* Initializing chefspec
|
100
|
-
* Initializing strainer
|
101
|
-
* Initializing rubocop
|
102
|
-
* Initializing foodcritic
|
103
98
|
* Initializing serverspec
|
104
|
-
|
105
|
-
|
106
|
-
Cookbook test-cookbook created successfully
|
99
|
+
this is the test cookbook.
|
100
|
+
Cookbook test created successfully
|
107
101
|
Next steps...
|
108
|
-
$ cd /Users/tprice/Desktop/test
|
102
|
+
$ cd /Users/tprice/Desktop/test
|
109
103
|
$ bundle install
|
110
104
|
$ bundle exec berks install
|
111
|
-
$ bundle exec
|
112
|
-
|
113
|
-
➜ cd ~/Desktop/test-cookbook
|
114
|
-
➜ bundle install
|
115
|
-
Fetching gem metadata from https://rubygems.org/
|
116
|
-
Fetching additional metadata from https://rubygems.org/
|
117
|
-
Resolving dependencies...
|
118
|
-
...
|
119
|
-
...
|
120
|
-
Your bundle is complete!
|
121
|
-
➜ bundle exec berks install
|
122
|
-
Using test (0.1.0) from metadata
|
123
|
-
➜ bundle exec strainer test
|
124
|
-
...
|
125
|
-
...
|
105
|
+
$ bundle exec rake -T
|
106
|
+
...
|
126
107
|
``````
|
127
108
|
|
128
109
|
And so on!
|
data/bin/cabinet
CHANGED
@@ -26,7 +26,7 @@ opt_parser = OptionParser.new do |opt|
|
|
26
26
|
opt.on('-m', '--email EMAIL', 'The email address for the individual who maintains the cookbook.') do |email|
|
27
27
|
options[:email] = email
|
28
28
|
end
|
29
|
-
opt.on('-u', '--update', 'Update the Gemfile, Chefignore, Guardfile, rubocop.yml, and the
|
29
|
+
opt.on('-u', '--update', 'Update the Gemfile, Chefignore, Guardfile, rubocop.yml, and the Rakefile.') do
|
30
30
|
options[:update] = true
|
31
31
|
end
|
32
32
|
opt.on('-h', '--help', 'help') do
|
@@ -87,6 +87,13 @@ elsif cookbook_name
|
|
87
87
|
puts " $ cd #{cookbook_path}"
|
88
88
|
puts ' $ bundle install'
|
89
89
|
puts ' $ bundle exec berks install'
|
90
|
-
puts ' $ bundle exec
|
90
|
+
puts ' $ bundle exec rake -T'
|
91
|
+
puts 'rake integration # Run Test Kitchen integration tests'
|
92
|
+
puts 'rake kitchen:all # Run all test instances'
|
93
|
+
puts 'rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance'
|
94
|
+
puts 'rake spec # Run ChefSpec unit tests'
|
95
|
+
puts 'rake style # Run all style checks'
|
96
|
+
puts 'rake style:chef # Lint Chef cookbooks'
|
97
|
+
puts 'rake style:ruby # Run Ruby style checks'
|
91
98
|
exit
|
92
99
|
end
|
data/kitchen-cabinet.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "kitchen-cabinet"
|
3
|
-
s.version = '
|
3
|
+
s.version = '2.0.0'
|
4
4
|
s.date = Time.now.strftime("%Y-%m-%d")
|
5
5
|
s.homepage = 'https://github.com/onehealth/kitchen-cabinet'
|
6
6
|
s.summary = 'Initializes a chef cookbook repo with relevant tools'
|
@@ -22,9 +22,13 @@ class Cabinet
|
|
22
22
|
create_cookbook = Chef::Knife::CookbookCreate.new
|
23
23
|
create_cookbook.name_args = [cookbook_name]
|
24
24
|
create_cookbook.config[:cookbook_path] = options[:path]
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
if File.exists?(File.join(ENV['HOME'], '.chef', 'knife.rb'))
|
26
|
+
require 'chef'
|
27
|
+
Chef::Config.from_file(File.join(ENV['HOME'], '.chef', 'knife.rb'))
|
28
|
+
end
|
29
|
+
create_cookbook.config[:cookbook_copyright] = options[:copyright] || Chef::Config[:cookbook_copyright]
|
30
|
+
create_cookbook.config[:cookbook_license] = options[:license] || Chef::Config[:cookbook_license]
|
31
|
+
create_cookbook.config[:cookbook_email] = options[:email] || Chef::Config[:cookbook_email]
|
28
32
|
create_cookbook.run
|
29
33
|
%w{ metadata.rb recipes/default.rb }.each do |file|
|
30
34
|
puts "\tRewriting #{file}"
|
@@ -70,7 +74,7 @@ class Cabinet
|
|
70
74
|
end
|
71
75
|
|
72
76
|
def self.write_configs(cookbook_name, options, cookbook_path)
|
73
|
-
@template = %w(chefignore .gitignore Gemfile Berksfile .kitchen.yml Guardfile
|
77
|
+
@template = %w(chefignore .gitignore Gemfile Berksfile .kitchen.yml Guardfile Rakefile .rubocop.yml)
|
74
78
|
puts 'this is the ' + cookbook_name + ' cookbook.'
|
75
79
|
require 'kitchen-cabinet/config'
|
76
80
|
@template.each do |template|
|
@@ -15,12 +15,13 @@ end
|
|
15
15
|
|
16
16
|
group :release do
|
17
17
|
gem 'stove', '~> 1.1'
|
18
|
+
# gem 'stove', '~> 2.0.0.beta.2'
|
18
19
|
gem 'rspec_junit_formatter'
|
19
20
|
gem 'rubocop-checkstyle_formatter'
|
20
21
|
end
|
21
22
|
|
22
23
|
group :development do
|
23
|
-
gem '
|
24
|
+
gem 'rake', '~> 10.1'
|
24
25
|
gem 'serverspec', '~> 0.14.2'
|
25
26
|
gem 'guard', '~> 1.8'
|
26
27
|
gem 'guard-rubocop', '~> 0.2'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
namespace :style do
|
5
|
+
require 'rubocop/rake_task'
|
6
|
+
desc 'Run Ruby style checks'
|
7
|
+
Rubocop::RakeTask.new(:ruby)
|
8
|
+
|
9
|
+
require 'foodcritic'
|
10
|
+
desc 'Run Chef style checks'
|
11
|
+
FoodCritic::Rake::LintTask.new(:chef)
|
12
|
+
end
|
13
|
+
|
14
|
+
desc 'Run all style checks'
|
15
|
+
task style: ['style:chef', 'style:ruby']
|
16
|
+
|
17
|
+
require 'kitchen'
|
18
|
+
desc 'Run Test Kitchen integration tests'
|
19
|
+
task :integration do
|
20
|
+
Kitchen.logger = Kitchen.default_file_logger
|
21
|
+
Kitchen::Config.new.instances.each do |instance|
|
22
|
+
instance.test(:always)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'rspec/core/rake_task'
|
27
|
+
desc 'Run ChefSpec unit tests'
|
28
|
+
RSpec::Core::RakeTask.new(:spec) do |t, args|
|
29
|
+
t.rspec_opts = 'test/unit/spec'
|
30
|
+
end
|
31
|
+
|
32
|
+
# The default task runs all tests.
|
33
|
+
task default: ['style', 'spec', 'integration']
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# The Update class helps you maintain the versions and config of your cookbook creation tools
|
5
5
|
class Update
|
6
6
|
def self.update_cookbook(cookbook_name, options, cookbook_path)
|
7
|
-
@template = %w(chefignore Gemfile Guardfile
|
7
|
+
@template = %w(chefignore Gemfile Guardfile Rakefile .rubocop.yml)
|
8
8
|
require 'kitchen-cabinet/config'
|
9
9
|
puts "Updating #{cookbook_name}..."
|
10
10
|
@template.each do |template|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-cabinet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Price
|
@@ -202,7 +202,7 @@ files:
|
|
202
202
|
- lib/kitchen-cabinet/templates/Berksfile.eruby
|
203
203
|
- lib/kitchen-cabinet/templates/Gemfile.eruby
|
204
204
|
- lib/kitchen-cabinet/templates/Guardfile.eruby
|
205
|
-
- lib/kitchen-cabinet/templates/
|
205
|
+
- lib/kitchen-cabinet/templates/Rakefile.eruby
|
206
206
|
- lib/kitchen-cabinet/templates/chefignore.eruby
|
207
207
|
- lib/kitchen-cabinet/templates/chefspec/default_spec.rb.eruby
|
208
208
|
- lib/kitchen-cabinet/templates/chefspec/spec_helper.rb.eruby
|
@@ -226,9 +226,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: 1.9.3
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
requirements:
|
229
|
-
- - "
|
229
|
+
- - ">="
|
230
230
|
- !ruby/object:Gem::Version
|
231
|
-
version:
|
231
|
+
version: '0'
|
232
232
|
requirements: []
|
233
233
|
rubyforge_project:
|
234
234
|
rubygems_version: 2.2.2
|