kitchen-cabinet 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +15 -14
- data/README.md +27 -18
- data/bin/cabinet +2 -2
- data/kitchen-cabinet.gemspec +2 -4
- data/lib/kitchen-cabinet/cabinet.rb +29 -14
- data/lib/kitchen-cabinet/templates/.gitignore.eruby +0 -1
- data/lib/kitchen-cabinet/templates/.rubocop.yml.eruby +4 -1
- data/lib/kitchen-cabinet/templates/Gemfile.eruby +15 -14
- data/lib/kitchen-cabinet/templates/Thorfile.eruby +46 -0
- data/lib/kitchen-cabinet/templates/VERSION.eruby +1 -0
- data/lib/kitchen-cabinet/update.rb +1 -1
- metadata +5 -44
- data/lib/kitchen-cabinet/templates/Rakefile.eruby +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04569a208aaadc6fa866488135116aef67fd515e
|
4
|
+
data.tar.gz: c53bdbdde59ef73fa8e5fbb514a38c4bbfef5626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f80259cb8398ab949829d41a1e52e5ec7319ac54511a6e1817fa53bf0e8057cc2e61f3c1d3441a312f5cfc45f5644126afb32c242e9bc7146fe79487abf3b0e9
|
7
|
+
data.tar.gz: a685428d38a2b494a6e011df82e5f2b625ae7e21e71f2563409da05418537c7d63641817a01fd49e869eb9e00b4e5d7262ba033b0aa1f53a4118a4e4ef5fa884
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## v2.1.0
|
2
|
+
* Updated dependencies
|
3
|
+
* Made the Gemfile a bit less restricive by locking minor version and allowing patch updates.
|
4
|
+
* Removed rakefile - Guard runs all tests in userland.
|
5
|
+
* Added Thorfile - thor-scmversion. Will possibly add tests in to thorfile for easier CI setup in the future.
|
6
|
+
* Moved metadata version to external VERSION file.
|
7
|
+
* Allow Gemfile.lock to be commited for --deployment mode bundler.
|
8
|
+
* Check for omnibus/gem chef and use the already installed version. If you have no version of chef installed, this tells you to install it. Definitely supports Linux/OS X, probably supports Windows as well.
|
9
|
+
* Uses thor for tests, publishing, and scm-version (mainly for CI). Also includes command to run tests and push to git (note that this does not commit for you).
|
10
|
+
|
1
11
|
## v2.0.1
|
2
12
|
* Fixed `cabinet update` command.
|
3
13
|
* Vastly simplified bin logic
|
data/Gemfile
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'berkshelf', '~> 2.0.14'
|
4
|
-
gem 'chef', '~> 11.8'
|
3
|
+
gem 'berkshelf', '~> 2.0', '>= 2.0.14'
|
4
|
+
gem 'chef', '~> 11.8', '>= 11.8.0'
|
5
5
|
|
6
6
|
group :unit do
|
7
|
-
gem 'foodcritic', '~> 3.0'
|
8
|
-
gem 'rubocop', '~> 0.18.0'
|
9
|
-
gem 'chefspec', '~> 3.2.0'
|
7
|
+
gem 'foodcritic', '~> 3', '>= 3.0.0'
|
8
|
+
gem 'rubocop', '~> 0.18', '>= 0.18.0'
|
9
|
+
gem 'chefspec', '~> 3.2', '>= 3.2.0'
|
10
10
|
end
|
11
11
|
|
12
12
|
group :integration do
|
13
|
-
gem 'test-kitchen', '~> 1.1'
|
14
|
-
gem 'kitchen-vagrant'
|
13
|
+
gem 'test-kitchen', '~> 1.1', '>= 1.1.0'
|
14
|
+
gem 'kitchen-vagrant', '~> 0', '>= 0.14.0'
|
15
15
|
end
|
16
16
|
|
17
17
|
group :release do
|
18
|
-
gem '
|
19
|
-
gem 'stove', '~> 1.1'
|
18
|
+
gem 'stove', '~> 1.1', '>= 1.1.0'
|
20
19
|
gem 'rspec_junit_formatter'
|
21
20
|
gem 'rubocop-checkstyle_formatter'
|
22
21
|
end
|
23
22
|
|
24
23
|
group :development do
|
25
|
-
gem '
|
26
|
-
gem '
|
27
|
-
gem 'guard
|
28
|
-
gem 'guard-
|
29
|
-
gem 'guard-
|
24
|
+
gem 'rake', '~> 10.1', '>= 10.1.0'
|
25
|
+
gem 'serverspec', '~> 0.14', '>= 0.14.2'
|
26
|
+
gem 'guard', '~> 1.8', '>= 1.8.3'
|
27
|
+
gem 'guard-rubocop', '~> 0.2', '>= 0.2.2'
|
28
|
+
gem 'guard-foodcritic', '~> 1.0', '>= 1.0.0'
|
29
|
+
gem 'guard-kitchen', '~> 0.0', '>= 0.0.0'
|
30
|
+
gem 'guard-rspec', '~> 3.1', '>= 3.1.0'
|
30
31
|
gem 'rb-fsevent', :require => false
|
31
32
|
gem 'rb-inotify', :require => false
|
32
33
|
gem 'terminal-notifier-guard', :require => false
|
data/README.md
CHANGED
@@ -14,39 +14,42 @@ It will automatically create a Gemfile for you with different groups set up for
|
|
14
14
|
`````` ruby
|
15
15
|
source 'https://rubygems.org'
|
16
16
|
|
17
|
-
gem 'berkshelf', '~> 2.0.14'
|
17
|
+
gem 'berkshelf', '~> 2.0', '>= 2.0.14'
|
18
|
+
gem 'chef', '~> 11.8', '>= 11.8.0'
|
18
19
|
|
19
20
|
group :unit do
|
20
|
-
gem 'foodcritic', '~> 3.0'
|
21
|
-
gem 'rubocop', '~> 0.18.0'
|
22
|
-
gem 'chefspec', '~> 3.2.0'
|
21
|
+
gem 'foodcritic', '~> 3', '>= 3.0.0'
|
22
|
+
gem 'rubocop', '~> 0.18', '>= 0.18.0'
|
23
|
+
gem 'chefspec', '~> 3.2', '>= 3.2.0'
|
23
24
|
end
|
24
25
|
|
25
26
|
group :integration do
|
26
|
-
gem 'test-kitchen', '~> 1.
|
27
|
-
gem 'kitchen-vagrant'
|
27
|
+
gem 'test-kitchen', '~> 1.1', '>= 1.1.0'
|
28
|
+
gem 'kitchen-vagrant', '~> 0', '>= 0.14.0'
|
28
29
|
end
|
29
30
|
|
30
31
|
group :release do
|
31
|
-
gem 'stove', '~> 1.1'
|
32
32
|
gem 'rspec_junit_formatter'
|
33
33
|
gem 'rubocop-checkstyle_formatter'
|
34
|
+
gem 'thor-scmversion', '~> 1.4', '>= 1.4.0'
|
35
|
+
gem 'git', '~> 1.2', '>= 1.2.6'
|
34
36
|
end
|
35
37
|
|
36
38
|
group :development do
|
37
|
-
gem '
|
38
|
-
gem '
|
39
|
-
gem 'guard',
|
40
|
-
gem 'guard-
|
41
|
-
gem 'guard-
|
42
|
-
gem 'guard-
|
43
|
-
gem 'guard-rspec', '~> 3.0'
|
39
|
+
gem 'serverspec', '~> 0.14', '>= 0.14.2'
|
40
|
+
gem 'guard', '~> 1.8', '>= 1.8.3'
|
41
|
+
gem 'guard-rubocop', '~> 0.2', '>= 0.2.2'
|
42
|
+
gem 'guard-foodcritic', '~> 1.0', '>= 1.0.0'
|
43
|
+
gem 'guard-kitchen', '~> 0.0', '>= 0.0.0'
|
44
|
+
gem 'guard-rspec', '~> 3.1', '>= 3.1.0'
|
44
45
|
gem 'rb-fsevent', :require => false
|
45
46
|
gem 'rb-inotify', :require => false
|
46
47
|
gem 'terminal-notifier-guard', :require => false
|
47
48
|
end
|
48
49
|
``````
|
49
50
|
|
51
|
+
* The versions in the README may get out of date. Please look in lib/kitchen-cabinet/templates for the up-to-date Gemfile.
|
52
|
+
|
50
53
|
The goal of this project is to prevent any manual setup of the cookbook environment. We used to copy Gemfiles and other configurations from cookbook to cookbook, making changes as needed. That quickly gets messy as things get out of date! With `cabinet`, every project starts with the same templated base.
|
51
54
|
|
52
55
|
Install
|
@@ -54,6 +57,8 @@ Install
|
|
54
57
|
|
55
58
|
`gem install kitchen-cabinet`
|
56
59
|
|
60
|
+
* In order to accomodate the most different use types, `kitchen-cabinet` supports omnibus and gem installations of chef. As such, it does not manage chef installation for you. Please install chef yourself before trying to use `kitchen-cabinet`.
|
61
|
+
|
57
62
|
Usage
|
58
63
|
=====
|
59
64
|
|
@@ -61,19 +66,24 @@ Usage
|
|
61
66
|
Usage: cabinet [options] <cookbook name>
|
62
67
|
|
63
68
|
Options
|
64
|
-
-o, --cookbook-path
|
69
|
+
-o, --cookbook-path PATH The directory where the cookbook will be created.
|
65
70
|
-C, --copyright COPYRIGHT_HOLDER The name of the copyright holder.
|
66
71
|
-I, --license LICENSE The type of license under which a cookbook is distributed: apachev2, gplv2, gplv3, mit, or none (default).
|
67
72
|
-m, --email EMAIL The email address for the individual who maintains the cookbook.
|
68
|
-
|
73
|
+
-u, --update Update the Gemfile, Chefignore, Guardfile, rubocop.yml, and the Rakefile.
|
69
74
|
-h, --help help
|
70
75
|
```
|
71
76
|
|
77
|
+
If you do not specify any options, `cabinet` will assume you want the defaults - it will read these from your knife.rb if available.
|
78
|
+
|
79
|
+
If you do not specify `-o` for a path to the directory you want to create your cookbook in, `cabinet` will create the new cookbook in your current directory. Likewise, if you say `cabinet update`, it will look in your current directory (which should be inside the cookbook) for files to update.
|
80
|
+
|
72
81
|
### Example
|
73
82
|
|
74
83
|
`````` bash
|
75
|
-
➜
|
84
|
+
➜ cabinet --cookbook-path ~/Desktop -C Taylor Price -I apachev2 -m tprice@onehealth.com test
|
76
85
|
* Initializing chef
|
86
|
+
Using chef from /opt/chef/embedded/lib/ruby/gems/1.9.1
|
77
87
|
** Creating cookbook test
|
78
88
|
** Creating README for cookbook: test
|
79
89
|
** Creating CHANGELOG for cookbook: test
|
@@ -102,7 +112,6 @@ Next steps...
|
|
102
112
|
$ cd /Users/tprice/Desktop/test
|
103
113
|
$ bundle install
|
104
114
|
$ bundle exec berks install
|
105
|
-
$ bundle exec rake -T
|
106
115
|
...
|
107
116
|
``````
|
108
117
|
|
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 Thorfile.') do
|
30
30
|
options[:update] = true
|
31
31
|
end
|
32
32
|
opt.on('-h', '--help', 'help') do
|
@@ -47,7 +47,7 @@ options[:update] = true if cookbook_name == 'update'
|
|
47
47
|
if options[:path].respond_to?(:to_str)
|
48
48
|
cookbook_path = File.join(options[:path], cookbook_name)
|
49
49
|
else
|
50
|
-
|
50
|
+
options[:path] = Dir.getwd
|
51
51
|
end
|
52
52
|
|
53
53
|
if cookbook_name == 'update'
|
data/kitchen-cabinet.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "kitchen-cabinet"
|
3
|
-
s.version = '2.0
|
3
|
+
s.version = '2.1.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'
|
7
7
|
s.description = <<EOF
|
8
8
|
`kitchen-cabinet` will create a chef cookbook skeleton complete with testing suite including:
|
9
|
-
berkshelf, chefspec, test
|
9
|
+
berkshelf, chefspec, test-kitchen, thor, foodcritic, rubocop, serverspec, thor-scmversion, and guard. It also creates a gemfile suitable for use in CI.
|
10
10
|
|
11
11
|
EOF
|
12
12
|
s.authors = ['Taylor Price']
|
@@ -19,12 +19,10 @@ EOF
|
|
19
19
|
s.files = `git ls-files`.split($/)
|
20
20
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
21
|
|
22
|
-
s.add_runtime_dependency 'chef', '~> 11.8', '>= 11.8.0'
|
23
22
|
s.add_runtime_dependency 'test-kitchen', '~> 1.1', '>= 1.1.1'
|
24
23
|
s.add_runtime_dependency 'bundler', '~> 1.5', '>= 1.5.1'
|
25
24
|
s.add_runtime_dependency 'berkshelf', '~> 2.0', '>= 2.0.12'
|
26
25
|
s.add_runtime_dependency 'git', '~> 1.2', '>= 1.2.6'
|
27
26
|
s.add_runtime_dependency 'erubis', '~> 2.7', '>= 2.7.0'
|
28
27
|
s.add_development_dependency 'rspec', '~> 2.14', '>= 2.14.1'
|
29
|
-
s.add_development_dependency 'rake', '~> 10.1', '>= 10.1.1'
|
30
28
|
end
|
@@ -18,19 +18,38 @@ class Cabinet
|
|
18
18
|
puts " $ cd #{cookbook_path}"
|
19
19
|
puts ' $ bundle install'
|
20
20
|
puts ' $ bundle exec berks install'
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.chef_check
|
24
|
+
if File.exists?('/opt/chef')
|
25
|
+
ENV['GEM_HOME'] = '/opt/chef/embedded/lib/ruby/gems/1.9.1'
|
26
|
+
elsif File.exists?('C:\opscode\chef\\')
|
27
|
+
ENV['GEM_HOME'] = 'C:\opscode\chef\embedded\lib\ruby\gems\1.9.1'
|
28
|
+
elsif Gem::Specification.find_by_name('chef')
|
29
|
+
ENV['GEM_HOME']
|
30
|
+
else
|
31
|
+
puts 'You don\'t appear to have chef installed.'
|
32
|
+
puts 'Please install the gem or omnibus version - `gem install chef` or http://www.getchef.com/chef/install/'
|
33
|
+
exit
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.chef_rewrite(cookbook_path)
|
38
|
+
%w{ metadata.rb recipes/default.rb }.each do |file|
|
39
|
+
puts "\tRewriting #{file}"
|
40
|
+
contents = "\# Encoding: utf-8\n#{File.read(File.join(cookbook_path, file))}"
|
41
|
+
File.open(File.join(cookbook_path, file), 'w') { |f| f.write(contents) }
|
42
|
+
end
|
43
|
+
metadata_replace = File.read(File.join(cookbook_path, 'metadata.rb'))
|
44
|
+
replace = metadata_replace.gsub(/version '0.1.0'/, "version IO.read(File.join(File.dirname(__FILE__), 'VERSION')) rescue \"0.1.0\"")
|
45
|
+
File.open(File.join(cookbook_path, 'metadata.rb'), 'w') { |file| file.puts replace }
|
29
46
|
end
|
30
47
|
|
31
48
|
def self.init_chef(cookbook_name, options, cookbook_path)
|
32
49
|
tool = 'chef'
|
33
50
|
puts "* Initializing #{tool}"
|
51
|
+
chef_check
|
52
|
+
puts "Using #{tool} from " + ENV['GEM_HOME']
|
34
53
|
require 'chef/knife/cookbook_create'
|
35
54
|
create_cookbook = Chef::Knife::CookbookCreate.new
|
36
55
|
create_cookbook.name_args = [cookbook_name]
|
@@ -43,11 +62,7 @@ class Cabinet
|
|
43
62
|
create_cookbook.config[:cookbook_license] = options[:license] || Chef::Config[:cookbook_license]
|
44
63
|
create_cookbook.config[:cookbook_email] = options[:email] || Chef::Config[:cookbook_email]
|
45
64
|
create_cookbook.run
|
46
|
-
|
47
|
-
puts "\tRewriting #{file}"
|
48
|
-
contents = "\# Encoding: utf-8\n#{File.read(File.join(cookbook_path, file))}"
|
49
|
-
File.open(File.join(cookbook_path, file), 'w') { |f| f.write(contents) }
|
50
|
-
end
|
65
|
+
chef_rewrite(cookbook_path)
|
51
66
|
end
|
52
67
|
|
53
68
|
def self.init_git(cookbook_name, options, cookbook_path)
|
@@ -87,7 +102,7 @@ class Cabinet
|
|
87
102
|
end
|
88
103
|
|
89
104
|
def self.write_configs(cookbook_name, options, cookbook_path)
|
90
|
-
@template = %w(chefignore .gitignore Gemfile Berksfile .kitchen.yml Guardfile
|
105
|
+
@template = %w(chefignore .gitignore Gemfile Berksfile .kitchen.yml Guardfile Thorfile .rubocop.yml VERSION)
|
91
106
|
puts 'this is the ' + cookbook_name + ' cookbook.'
|
92
107
|
require 'kitchen-cabinet/config'
|
93
108
|
@template.each do |template|
|
@@ -1,32 +1,33 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'berkshelf', '~> 2.0.14'
|
3
|
+
gem 'berkshelf', '~> 2.0', '>= 2.0.14'
|
4
|
+
gem 'chef', '~> 11.8', '>= 11.8.0'
|
4
5
|
|
5
6
|
group :unit do
|
6
|
-
gem 'foodcritic', '~> 3.0'
|
7
|
-
gem 'rubocop', '~> 0.18.0'
|
8
|
-
gem 'chefspec', '~> 3.2.0'
|
7
|
+
gem 'foodcritic', '~> 3', '>= 3.0.0'
|
8
|
+
gem 'rubocop', '~> 0.18', '>= 0.18.0'
|
9
|
+
gem 'chefspec', '~> 3.2', '>= 3.2.0'
|
9
10
|
end
|
10
11
|
|
11
12
|
group :integration do
|
12
|
-
gem 'test-kitchen', '~> 1.
|
13
|
-
gem 'kitchen-vagrant'
|
13
|
+
gem 'test-kitchen', '~> 1.1', '>= 1.1.0'
|
14
|
+
gem 'kitchen-vagrant', '~> 0', '>= 0.14.0'
|
14
15
|
end
|
15
16
|
|
16
17
|
group :release do
|
17
|
-
gem 'stove', '~> 1.1'
|
18
18
|
gem 'rspec_junit_formatter'
|
19
19
|
gem 'rubocop-checkstyle_formatter'
|
20
|
+
gem 'thor-scmversion', '~> 1.4', '>= 1.4.0'
|
21
|
+
gem 'git', '~> 1.2', '>= 1.2.6'
|
20
22
|
end
|
21
23
|
|
22
24
|
group :development do
|
23
|
-
gem '
|
24
|
-
gem '
|
25
|
-
gem 'guard',
|
26
|
-
gem 'guard-
|
27
|
-
gem 'guard-
|
28
|
-
gem 'guard-
|
29
|
-
gem 'guard-rspec', '~> 3.0'
|
25
|
+
gem 'serverspec', '~> 0.14', '>= 0.14.2'
|
26
|
+
gem 'guard', '~> 1.8', '>= 1.8.3'
|
27
|
+
gem 'guard-rubocop', '~> 0.2', '>= 0.2.2'
|
28
|
+
gem 'guard-foodcritic', '~> 1.0', '>= 1.0.0'
|
29
|
+
gem 'guard-kitchen', '~> 0.0', '>= 0.0.0'
|
30
|
+
gem 'guard-rspec', '~> 3.1', '>= 3.1.0'
|
30
31
|
gem 'rb-fsevent', :require => false
|
31
32
|
gem 'rb-inotify', :require => false
|
32
33
|
gem 'terminal-notifier-guard', :require => false
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'thor/scmversion'
|
4
|
+
# Thor tasks for different environments
|
5
|
+
|
6
|
+
# Runs rubocop
|
7
|
+
class Style < Thor
|
8
|
+
desc 'check', 'Run rubocop on all Ruby files'
|
9
|
+
def check
|
10
|
+
`foodcritic -f any . --tags ~FC007 --tags ~FC015 --tags ~FC023`
|
11
|
+
`rspec --format RspecJunitFormatter --out reports/test-results.xml`
|
12
|
+
`rubocop --require rubocop/formatter/checkstyle_formatter --format Rubocop::Formatter::CheckstyleFormatter --out reports/checkstyle-results.xml`
|
13
|
+
puts 'success'
|
14
|
+
begin
|
15
|
+
require 'kitchen/thor_tasks'
|
16
|
+
Kitchen::ThorTasks.new
|
17
|
+
rescue LoadError
|
18
|
+
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# publish cookbook from CI
|
24
|
+
class Ci < Thor
|
25
|
+
desc 'publish', 'Task for CI that publishes cookbook.'
|
26
|
+
def publish
|
27
|
+
require 'thor/rake_compat'
|
28
|
+
`thor version:bump patch`
|
29
|
+
`ssh-agent bash -c 'ssh-add /var/lib/jenkins/.ssh/jenkinsbuild_rsa; git push --tags'`
|
30
|
+
`berks upload`
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Runs Ci tasks as well as upload for actual CI
|
35
|
+
class Upload < Thor
|
36
|
+
desc 'prepare', 'Runs tests and uploads to git if successful'
|
37
|
+
def prepare
|
38
|
+
invoke 'style:check'
|
39
|
+
require 'git'
|
40
|
+
Git.init.push
|
41
|
+
end
|
42
|
+
desc 'scm', 'runs prepare and allows for version bump override'
|
43
|
+
def scm
|
44
|
+
invoke 'prepare'
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -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 Thorfile .rubocop.yml)
|
8
8
|
require 'kitchen-cabinet/config'
|
9
9
|
puts "Updating #{cookbook_name}..."
|
10
10
|
@template.each do |template|
|
metadata
CHANGED
@@ -1,35 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-cabinet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Price
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: chef
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '11.8'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 11.8.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '11.8'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 11.8.0
|
33
13
|
- !ruby/object:Gem::Dependency
|
34
14
|
name: test-kitchen
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,29 +130,9 @@ dependencies:
|
|
150
130
|
- - ">="
|
151
131
|
- !ruby/object:Gem::Version
|
152
132
|
version: 2.14.1
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rake
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '10.1'
|
160
|
-
- - ">="
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
version: 10.1.1
|
163
|
-
type: :development
|
164
|
-
prerelease: false
|
165
|
-
version_requirements: !ruby/object:Gem::Requirement
|
166
|
-
requirements:
|
167
|
-
- - "~>"
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
version: '10.1'
|
170
|
-
- - ">="
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: 10.1.1
|
173
133
|
description: |+
|
174
134
|
`kitchen-cabinet` will create a chef cookbook skeleton complete with testing suite including:
|
175
|
-
berkshelf, chefspec, test
|
135
|
+
berkshelf, chefspec, test-kitchen, thor, foodcritic, rubocop, serverspec, thor-scmversion, and guard. It also creates a gemfile suitable for use in CI.
|
176
136
|
|
177
137
|
email: tprice@onehealth.com
|
178
138
|
executables:
|
@@ -202,7 +162,8 @@ files:
|
|
202
162
|
- lib/kitchen-cabinet/templates/Berksfile.eruby
|
203
163
|
- lib/kitchen-cabinet/templates/Gemfile.eruby
|
204
164
|
- lib/kitchen-cabinet/templates/Guardfile.eruby
|
205
|
-
- lib/kitchen-cabinet/templates/
|
165
|
+
- lib/kitchen-cabinet/templates/Thorfile.eruby
|
166
|
+
- lib/kitchen-cabinet/templates/VERSION.eruby
|
206
167
|
- lib/kitchen-cabinet/templates/chefignore.eruby
|
207
168
|
- lib/kitchen-cabinet/templates/chefspec/default_spec.rb.eruby
|
208
169
|
- lib/kitchen-cabinet/templates/chefspec/spec_helper.rb.eruby
|
@@ -1,33 +0,0 @@
|
|
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']
|