meez 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/meez +2 -2
- metadata +1 -21
- data/.drone.yml +0 -12
- data/.gitignore +0 -3
- data/.rubocop.yml +0 -10
- data/Dockerfile +0 -18
- data/Gemfile +0 -20
- data/Guardfile +0 -7
- data/README.md +0 -155
- data/lib/meez/meez.rb +0 -181
- data/meez.gemspec +0 -23
- data/templates/.drone.yml.erb +0 -8
- data/templates/.kitchen.yml.erb +0 -16
- data/templates/.rubocop.yml.erb +0 -10
- data/templates/Dockerfile.erb +0 -10
- data/templates/Guardfile.erb +0 -15
- data/templates/Rakefile.erb +0 -40
- data/templates/Vagrantfile.erb +0 -19
- data/templates/chefspec/default_spec.rb.erb +0 -15
- data/templates/chefspec/spec_helper.rb.erb +0 -19
- data/templates/serverspec/default_spec.rb.erb +0 -7
- data/templates/serverspec/spec_helper.rb.erb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5bc191bf31600075391eb31a8088c595c34d685
|
4
|
+
data.tar.gz: 5ad5089e1b09bb86518a6d5645c478e6b04120b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2de2b83e7cd1f5a83a8b741c743472225666a6a74d9df2ddbfb14ff84a74991f62b92c32e3fa7f67b5fcbb21e01381180a88e9d74c3eaaa98727b1a61a8efdf
|
7
|
+
data.tar.gz: 465f4758dd73dd83c5ed91d299b34f1d8668ccee84e1a88f83c6b6a991a9bdc29ee3ccb5b5ead73c149f36bc05a297581bd6b277346bbb9bde5ba6fb45b0bb78
|
data/bin/meez
CHANGED
@@ -12,8 +12,8 @@ options = {
|
|
12
12
|
|
13
13
|
opt_parser = OptionParser.new do |opt|
|
14
14
|
opt.banner = 'Usage: meez [options] <cookbook name>'
|
15
|
-
opt.separator
|
16
|
-
opt.separator
|
15
|
+
opt.separator ''
|
16
|
+
opt.separator 'Options'
|
17
17
|
opt.on('-o', '--cookbook-path PATH', 'The directory where the cookbook will be created') do |path|
|
18
18
|
options[:path] = path
|
19
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Czarkowski
|
@@ -76,27 +76,7 @@ executables:
|
|
76
76
|
extensions: []
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
|
-
- ".drone.yml"
|
80
|
-
- ".gitignore"
|
81
|
-
- ".rubocop.yml"
|
82
|
-
- Dockerfile
|
83
|
-
- Gemfile
|
84
|
-
- Guardfile
|
85
|
-
- README.md
|
86
79
|
- bin/meez
|
87
|
-
- lib/meez/meez.rb
|
88
|
-
- meez.gemspec
|
89
|
-
- templates/.drone.yml.erb
|
90
|
-
- templates/.kitchen.yml.erb
|
91
|
-
- templates/.rubocop.yml.erb
|
92
|
-
- templates/Dockerfile.erb
|
93
|
-
- templates/Guardfile.erb
|
94
|
-
- templates/Rakefile.erb
|
95
|
-
- templates/Vagrantfile.erb
|
96
|
-
- templates/chefspec/default_spec.rb.erb
|
97
|
-
- templates/chefspec/spec_helper.rb.erb
|
98
|
-
- templates/serverspec/default_spec.rb.erb
|
99
|
-
- templates/serverspec/spec_helper.rb.erb
|
100
80
|
homepage: http://github.com/paulczar/meez
|
101
81
|
licenses:
|
102
82
|
- apache2
|
data/.drone.yml
DELETED
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/Dockerfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
FROM racker/precise-with-updates
|
2
|
-
|
3
|
-
RUN apt-get -yqq update && apt-get -yqq install curl build-essential libxml2-dev libxslt-dev git autoconf wget
|
4
|
-
|
5
|
-
RUN wget -q -O /tmp/chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.1.0-1_amd64.deb \
|
6
|
-
&& dpkg -i /tmp/chefdk.deb \
|
7
|
-
&& rm /tmp/chefdk.deb
|
8
|
-
|
9
|
-
RUN wget -q -O /tmp/vagrant.deb http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.3.5_x86_64.deb \
|
10
|
-
&& dpkg -i /tmp/vagrant.deb \
|
11
|
-
&& rm /tmp/vagrant.deb
|
12
|
-
|
13
|
-
ENV PATH /opt/chefdk/embedded/bin:/root/.chefdk/gem/ruby/2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
14
|
-
ENV USE_SYSTEM_GECODE 1
|
15
|
-
|
16
|
-
ADD Gemfile /tmp/Gemfile
|
17
|
-
|
18
|
-
RUN cd /tmp && bundle install && rm Gemfile*
|
data/Gemfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'berkshelf', '> 3'
|
4
|
-
gem 'chef', '>= 11.8'
|
5
|
-
gem 'rake', '>= 10.2'
|
6
|
-
gem 'rubocop', '>= 0.21'
|
7
|
-
gem 'foodcritic', '>= 3.0'
|
8
|
-
gem 'chefspec', '>= 3.4'
|
9
|
-
gem 'serverspec', '>= 1.6'
|
10
|
-
gem 'guard', '>= 2.6'
|
11
|
-
gem 'guard-rubocop', '>= 1.1'
|
12
|
-
gem 'guard-foodcritic', '>= 1.0.2'
|
13
|
-
gem 'test-kitchen'
|
14
|
-
gem 'kitchen-vagrant'
|
15
|
-
gem 'kitchen-docker'
|
16
|
-
|
17
|
-
#group :infinite_loop_solver do
|
18
|
-
# gem 'celluloid', '~> 0.14'
|
19
|
-
# gem 'celluloid-io', '~> 0.14'
|
20
|
-
#end
|
data/Guardfile
DELETED
data/README.md
DELETED
@@ -1,155 +0,0 @@
|
|
1
|
-
Meez
|
2
|
-
----
|
3
|
-
|
4
|
-
About
|
5
|
-
=====
|
6
|
-
|
7
|
-
`Meez` is slang for `mise en place`
|
8
|
-
|
9
|
-
`Mise en place` is a French phrase which means "putting in place", as in set up. It is used in professional kitchens to refer to organizing and arranging the ingredients (e.g., cuts of meat, relishes, sauces, par-cooked items, spices, freshly chopped vegetables, and other components) that a cook will require for the menu items that he or she expects to prepare during his/her shift.[1] The practice is also effective in home kitchens.
|
10
|
-
|
11
|
-
`Meez` will create an opinionated chef cookbook skeleton complete with testing suite.
|
12
|
-
|
13
|
-
Install
|
14
|
-
=======
|
15
|
-
|
16
|
-
Setting the environment variable `USE_SYSTEM_GECODE=1` will help speed up builds by using the system `gecode` rather than compiling it from scratch.
|
17
|
-
|
18
|
-
Official
|
19
|
-
----------
|
20
|
-
|
21
|
-
as of version `0.2.0` this is offered as a `chefdk` plugin.
|
22
|
-
|
23
|
-
`chef gem install meez`
|
24
|
-
|
25
|
-
Unofficial
|
26
|
-
-------------
|
27
|
-
|
28
|
-
Your results may vary using it outside of `chefdk`
|
29
|
-
|
30
|
-
`gem install meez`
|
31
|
-
|
32
|
-
|
33
|
-
Usage
|
34
|
-
=====
|
35
|
-
|
36
|
-
```
|
37
|
-
Usage: meez [options] <cookbook name>
|
38
|
-
|
39
|
-
Options
|
40
|
-
-o, --cookbook-path USERNAME The directory where the cookbook will be created
|
41
|
-
-C, --copyright COPYRIGHT_HOLDER The name of the copyright holder.
|
42
|
-
-I, --license LICENSE The type of license under which a cookbook is distributed: apachev2, gplv2, gplv3, mit, or none (default).
|
43
|
-
-m, --email EMAIL The email address for the individual who maintains the cookbook.
|
44
|
-
-d, --kitchen-driver DRIVER The driver which use test-kitchen for creating platform instances: vagrant (default), docker
|
45
|
-
-h, --help help
|
46
|
-
```
|
47
|
-
|
48
|
-
### Example
|
49
|
-
|
50
|
-
```
|
51
|
-
$ meez --cookbook-path /tmp --copyright Foo -I apachev2 -m foo@bah.com test
|
52
|
-
* Initializing Cookbook
|
53
|
-
** Creating cookbook test
|
54
|
-
** Creating README for cookbook: test
|
55
|
-
** Creating CHANGELOG for cookbook: test
|
56
|
-
** Creating metadata for cookbook: test
|
57
|
-
Rewriting metadata.rb
|
58
|
-
Rewriting recipes/default.rb
|
59
|
-
* Initializing Berkshelf
|
60
|
-
create /tmp/test/Berksfile
|
61
|
-
create /tmp/test/Thorfile
|
62
|
-
create /tmp/test/.gitignore
|
63
|
-
run git init from "/tmp/test"
|
64
|
-
create /tmp/test/Gemfile
|
65
|
-
* Initializing Vagranfile
|
66
|
-
* Initializing Knife
|
67
|
-
Append Gemfile
|
68
|
-
* Initializing Rakefile
|
69
|
-
Creating /tmp/test/Rakefile
|
70
|
-
* Initializing Rubocop
|
71
|
-
Append Gemfile
|
72
|
-
* Initializing Food Critic
|
73
|
-
Append Gemfile
|
74
|
-
* Initializing Chef Spec
|
75
|
-
Creating /tmp/test/test/unit/spec/spec_helper.rb
|
76
|
-
Creating /tmp/test/test/unit/spec/default_spec.rb
|
77
|
-
Append Gemfile
|
78
|
-
* Initializing Server Spec
|
79
|
-
Creating /tmp/test/test/integration/default/serverspec/spec_helper.rb
|
80
|
-
Creating /tmp/test/test/integration/default/serverspec/default_spec.rb
|
81
|
-
Append Gemfile
|
82
|
-
* Initializing Test Kitchen
|
83
|
-
create .kitchen.yml
|
84
|
-
append Rakefile
|
85
|
-
append Thorfile
|
86
|
-
exist test/integration/default
|
87
|
-
append .gitignore
|
88
|
-
append .gitignore
|
89
|
-
append Gemfile
|
90
|
-
append Gemfile
|
91
|
-
You must run `bundle install' to fetch any new gems.
|
92
|
-
Cookbook test created successfully
|
93
|
-
Next steps...
|
94
|
-
$ cd /tmp/test
|
95
|
-
$ export USE_SYSTEM_GECODE=1
|
96
|
-
$ bundle install
|
97
|
-
$ bundle exec berks install
|
98
|
-
|
99
|
-
$ cd /tmp/test
|
100
|
-
$ export USE_SYSTEM_GECODE=1
|
101
|
-
$ bundle install
|
102
|
-
Fetching gem metadata from https://rubygems.org/
|
103
|
-
Fetching additional metadata from https://rubygems.org/
|
104
|
-
Resolving dependencies...
|
105
|
-
...
|
106
|
-
...
|
107
|
-
Your bundle is complete!
|
108
|
-
$ bundle exec berks install
|
109
|
-
Using test (0.1.0) from metadata
|
110
|
-
$ bundle exec rake -T
|
111
|
-
rake integration # Run Test Kitchen integration tests
|
112
|
-
rake kitchen:all # Run all test instances
|
113
|
-
rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance
|
114
|
-
rake spec # Run ChefSpec unit tests
|
115
|
-
rake style # Run all style checks
|
116
|
-
rake style:chef # Lint Chef cookbooks
|
117
|
-
rake style:ruby # Run Ruby style checks
|
118
|
-
```
|
119
|
-
|
120
|
-
Contributing
|
121
|
-
------------
|
122
|
-
|
123
|
-
e.g.
|
124
|
-
|
125
|
-
1. Fork the repository on Github
|
126
|
-
2. Create a named feature branch (like `add_component_x`)
|
127
|
-
3. Write your change
|
128
|
-
4. Write tests for your change (if applicable)
|
129
|
-
5. Run the tests, ensuring they all pass
|
130
|
-
6. Submit a Pull Request using Github
|
131
|
-
|
132
|
-
License and Authors
|
133
|
-
-------------------
|
134
|
-
|
135
|
-
Authors:
|
136
|
-
========
|
137
|
-
|
138
|
-
Paul Czarkowski - paul.czarkowski@rackspace.com
|
139
|
-
|
140
|
-
License:
|
141
|
-
========
|
142
|
-
|
143
|
-
Copyright 2014 Paul Czarkowski, Rackspace Inc.
|
144
|
-
|
145
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
146
|
-
you may not use this file except in compliance with the License.
|
147
|
-
You may obtain a copy of the License at
|
148
|
-
|
149
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
150
|
-
|
151
|
-
Unless required by applicable law or agreed to in writing, software
|
152
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
153
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
154
|
-
See the License for the specific language governing permissions and
|
155
|
-
limitations under the License.
|
data/lib/meez/meez.rb
DELETED
@@ -1,181 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
# The main Meez driver
|
3
|
-
class Meez
|
4
|
-
require 'fileutils'
|
5
|
-
|
6
|
-
def self.init(cookbook_name, options)
|
7
|
-
init_cookbook(cookbook_name, options)
|
8
|
-
init_berkshelf(cookbook_name, options)
|
9
|
-
init_vagrant(cookbook_name, options)
|
10
|
-
init_knife(cookbook_name, options)
|
11
|
-
init_rakefile(cookbook_name, options)
|
12
|
-
init_rubocop(cookbook_name, options)
|
13
|
-
init_foodcritic(cookbook_name, options)
|
14
|
-
init_chefspec(cookbook_name, options)
|
15
|
-
init_serverspec(cookbook_name, options)
|
16
|
-
init_kitchenci(cookbook_name, options)
|
17
|
-
init_guard(cookbook_name, options)
|
18
|
-
init_drone(cookbook_name, options)
|
19
|
-
init_docker(cookbook_name, options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.write_template(name, path, cookbook_name, options)
|
23
|
-
require 'erb'
|
24
|
-
template = File.join(File.dirname(__FILE__), '../../templates', name)
|
25
|
-
target = File.join(path, File.basename(name, '.erb'))
|
26
|
-
puts "\tCreating #{target} from template"
|
27
|
-
content = ERB.new File.new(template).read
|
28
|
-
File.open(target, 'w') { |f| f.write(content.result(binding)) }
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.append_file(file, content)
|
32
|
-
File.open(file, 'a') { |f| f.write("#{content}\n") }
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.add_gem(cookbook_path, name, version = nil)
|
36
|
-
puts "adding #{name} gem to Gemfile"
|
37
|
-
if version
|
38
|
-
append_file(File.join(cookbook_path, 'Gemfile'), "gem '#{name}', '#{version}'")
|
39
|
-
else
|
40
|
-
append_file(File.join(cookbook_path, 'Gemfile'), "gem '#{name}'")
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.gitignore(cookbook_path, file)
|
45
|
-
append_file(File.join(cookbook_path, '.gitignore'), file)
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.init_cookbook(cookbook_name, options)
|
49
|
-
require 'chef/knife/cookbook_create'
|
50
|
-
puts '* Initializing Cookbook'
|
51
|
-
path = File.join(options[:path], cookbook_name)
|
52
|
-
create_cookbook = Chef::Knife::CookbookCreate.new
|
53
|
-
create_cookbook.name_args = [cookbook_name]
|
54
|
-
create_cookbook.config[:cookbook_path] = options[:path]
|
55
|
-
create_cookbook.config[:cookbook_copyright] = options[:copyright] || 'YOUR_COMPANY_NAME'
|
56
|
-
create_cookbook.config[:cookbook_license] = options[:license] || 'YOUR_EMAIL'
|
57
|
-
create_cookbook.config[:cookbook_email] = options[:email] || 'none'
|
58
|
-
create_cookbook.run
|
59
|
-
%w{ metadata.rb recipes/default.rb }.each do |file|
|
60
|
-
puts "\tRewriting #{file}"
|
61
|
-
contents = "# Encoding: utf-8\n#{File.read(File.join(path, file))}"
|
62
|
-
File.open(File.join(path, file), 'w') { |f| f.write(contents) }
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.init_git(cookbook_name, options)
|
67
|
-
puts '* Initializing GIT repo'
|
68
|
-
path = File.join(options[:path], cookbook_name)
|
69
|
-
require 'git'
|
70
|
-
Git.init(path, repository: path)
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.init_berkshelf(cookbook_name, options)
|
74
|
-
puts '* Initializing Berkshelf'
|
75
|
-
path = File.join(options[:path], cookbook_name)
|
76
|
-
require 'berkshelf'
|
77
|
-
require 'berkshelf/base_generator'
|
78
|
-
require 'berkshelf/init_generator'
|
79
|
-
Berkshelf::InitGenerator.new(
|
80
|
-
[path],
|
81
|
-
skip_test_kitchen: true,
|
82
|
-
skip_vagrant: true
|
83
|
-
).invoke_all
|
84
|
-
contents = File.read(File.join(path, 'Gemfile'))
|
85
|
-
newgemfile = contents.gsub("\ngem 'berkshelf'\n","\ngem 'berkshelf', '> 3'\n")
|
86
|
-
File.open(File.join(path, 'Gemfile'), 'w') { |f| f.write(newgemfile) }
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.init_kitchenci(cookbook_name, options)
|
90
|
-
puts '* Initializing Test Kitchen'
|
91
|
-
path = File.join(options[:path], cookbook_name)
|
92
|
-
require 'kitchen'
|
93
|
-
require 'kitchen/generator/init'
|
94
|
-
Kitchen::Generator::Init.new([], {}, destination_root: path).invoke_all
|
95
|
-
options[:driver] ||= "vagrant"
|
96
|
-
write_template('.kitchen.yml.erb', path, cookbook_name, options)
|
97
|
-
add_gem(path, 'kitchen-docker', '>=0.15.0') if options[:driver].eql? "docker"
|
98
|
-
end
|
99
|
-
|
100
|
-
def self.init_vagrant(cookbook_name, options)
|
101
|
-
puts '* Initializing Vagranfile'
|
102
|
-
path = File.join(options[:path], cookbook_name)
|
103
|
-
write_template('Vagrantfile.erb', path, cookbook_name, options)
|
104
|
-
end
|
105
|
-
|
106
|
-
def self.init_chefspec(cookbook_name, options)
|
107
|
-
puts '* Initializing Chef Spec'
|
108
|
-
path = File.join(options[:path], cookbook_name)
|
109
|
-
spec_path = File.join(path, 'test', 'unit', 'spec')
|
110
|
-
FileUtils.mkdir_p(spec_path)
|
111
|
-
write_template('chefspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
|
112
|
-
write_template('chefspec/default_spec.rb.erb', spec_path, cookbook_name, options)
|
113
|
-
gitignore(path, '.coverage/*')
|
114
|
-
add_gem(path, 'chefspec', '>= 3.4')
|
115
|
-
end
|
116
|
-
|
117
|
-
def self.init_rakefile(cookbook_name, options)
|
118
|
-
puts '* Initializing Rakefile'
|
119
|
-
path = File.join(options[:path], cookbook_name)
|
120
|
-
write_template('Rakefile.erb', path, cookbook_name, options)
|
121
|
-
add_gem(path, 'rake', '>= 10.2')
|
122
|
-
end
|
123
|
-
|
124
|
-
def self.init_rubocop(cookbook_name, options)
|
125
|
-
puts '* Initializing Rubocop'
|
126
|
-
path = File.join(options[:path], cookbook_name)
|
127
|
-
write_template('.rubocop.yml.erb', path, cookbook_name, options)
|
128
|
-
add_gem(path, 'rubocop', '>= 0.21')
|
129
|
-
end
|
130
|
-
|
131
|
-
def self.init_knife(cookbook_name, options)
|
132
|
-
puts '* Initializing Knife'
|
133
|
-
path = File.join(options[:path], cookbook_name)
|
134
|
-
add_gem(path, 'chef', '>= 11.8')
|
135
|
-
end
|
136
|
-
|
137
|
-
def self.init_foodcritic(cookbook_name, options)
|
138
|
-
puts '* Initializing Food Critic'
|
139
|
-
path = File.join(options[:path], cookbook_name)
|
140
|
-
add_gem(path, 'foodcritic', '>= 3.0')
|
141
|
-
end
|
142
|
-
|
143
|
-
def self.init_serverspec(cookbook_name, options)
|
144
|
-
puts '* Initializing Server Spec'
|
145
|
-
path = File.join(options[:path], cookbook_name)
|
146
|
-
spec_path = File.join(path, 'test', 'integration', 'default', 'serverspec')
|
147
|
-
FileUtils.mkdir_p(spec_path)
|
148
|
-
write_template('serverspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
|
149
|
-
write_template('serverspec/default_spec.rb.erb', spec_path, cookbook_name, options)
|
150
|
-
add_gem(path, 'serverspec', '>= 1.6')
|
151
|
-
end
|
152
|
-
|
153
|
-
def self.init_guard(cookbook_name, options)
|
154
|
-
puts '* Initializing Guard'
|
155
|
-
path = File.join(options[:path], cookbook_name)
|
156
|
-
write_template('Guardfile.erb', path, cookbook_name, options)
|
157
|
-
add_gem(path, 'guard', '>= 2.6')
|
158
|
-
add_gem(path, 'guard-rubocop', '>= 1.1')
|
159
|
-
add_gem(path, 'guard-foodcritic', '>= 1.0.2')
|
160
|
-
end
|
161
|
-
|
162
|
-
def self.init_drone(cookbook_name, options)
|
163
|
-
puts '* Initializing Drone'
|
164
|
-
path = File.join(options[:path], cookbook_name)
|
165
|
-
write_template('.drone.yml.erb', path, cookbook_name, options)
|
166
|
-
end
|
167
|
-
|
168
|
-
def self.init_docker(cookbook_name, options)
|
169
|
-
puts '* Initializing Docker'
|
170
|
-
path = File.join(options[:path], cookbook_name)
|
171
|
-
write_template('Dockerfile.erb', path, cookbook_name, options)
|
172
|
-
end
|
173
|
-
|
174
|
-
def self.bundle_install(cookbook_name, options)
|
175
|
-
require 'bundler'
|
176
|
-
puts '* Running bundle install'
|
177
|
-
path = File.join(options[:path], cookbook_name)
|
178
|
-
puts "\t append .gitignore"
|
179
|
-
Bundler.with_clean_env { exec({ 'BUNDLE_GEMFILE' => "#{path}/Gemfile" }, 'bundle install') }
|
180
|
-
end
|
181
|
-
end
|
data/meez.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = %q{meez}
|
3
|
-
s.version = '0.2.2'
|
4
|
-
s.date = %q{2014-01-08}
|
5
|
-
s.summary = 'Initializes a chef cookbook with TDD framework'
|
6
|
-
s.description = <<EOF
|
7
|
-
`Meez` (slang for `mise en place`) will create an opinionated chef cookbook skeleton complete with testing suite including:
|
8
|
-
berkshelf, chefspec, test kitchen, foodcritic, server spec
|
9
|
-
|
10
|
-
EOF
|
11
|
-
s.files = %x{git ls-files}.split("\n")
|
12
|
-
|
13
|
-
s.executables = ['meez']
|
14
|
-
s.authors = ['Paul Czarkowski']
|
15
|
-
s.email = 'paul.czarkowski@rackspace.com'
|
16
|
-
s.homepage = 'http://github.com/paulczar/meez'
|
17
|
-
s.license = 'apache2'
|
18
|
-
s.require_paths = ['lib']
|
19
|
-
s.add_dependency 'chef', '~> 11.8'
|
20
|
-
s.add_dependency 'test-kitchen', '~> 1.2'
|
21
|
-
s.add_dependency 'bundler', '~> 1.5'
|
22
|
-
s.add_dependency 'berkshelf', '~> 3.1'
|
23
|
-
end
|
data/templates/.drone.yml.erb
DELETED
data/templates/.kitchen.yml.erb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
---
|
2
|
-
driver:
|
3
|
-
<% case options[:driver] when "vagrant" %>name: vagrant
|
4
|
-
<% when "docker" %>name: docker
|
5
|
-
provision_command: curl -L http://www.opscode.com/chef/install.sh | bash
|
6
|
-
<% end %>
|
7
|
-
provisioner:
|
8
|
-
name: chef_solo
|
9
|
-
|
10
|
-
platforms:
|
11
|
-
- name: ubuntu-12.04
|
12
|
-
|
13
|
-
suites:
|
14
|
-
- name: default
|
15
|
-
run_list: recipe[<%= cookbook_name %>::default]
|
16
|
-
attributes:
|
data/templates/.rubocop.yml.erb
DELETED
data/templates/Dockerfile.erb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# builds docker container to be used with CI
|
2
|
-
|
3
|
-
FROM paulczar/meez
|
4
|
-
|
5
|
-
ADD Gemfile /tmp/Gemfile
|
6
|
-
|
7
|
-
ENV PATH /opt/chefdk/embedded/bin:/root/.chefdk/gem/ruby/2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
8
|
-
ENV USE_SYSTEM_GECODE 1
|
9
|
-
|
10
|
-
RUN cd /tmp && bundle install
|
data/templates/Guardfile.erb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# Guardfile built by Meez ( http://github.com/paulczar/meez )
|
2
|
-
# for testing your chef cookbooks.
|
3
|
-
|
4
|
-
guard :rubocop do
|
5
|
-
watch(%r{.+\.rb$})
|
6
|
-
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
7
|
-
end
|
8
|
-
|
9
|
-
guard :foodcritic, cookbook_paths: '.', cli: ['--epic-fail', 'any'] do
|
10
|
-
watch(%r{attributes/.+\.rb$})
|
11
|
-
watch(%r{providers/.+\.rb$})
|
12
|
-
watch(%r{recipes/.+\.rb$})
|
13
|
-
watch(%r{resources/.+\.rb$})
|
14
|
-
watch(%r{metadata\.rb$})
|
15
|
-
end
|
data/templates/Rakefile.erb
DELETED
@@ -1,40 +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 rake task should just run it all
|
33
|
-
task default: ['style', 'spec', 'integration']
|
34
|
-
|
35
|
-
begin
|
36
|
-
require 'kitchen/rake_tasks'
|
37
|
-
Kitchen::RakeTasks.new
|
38
|
-
rescue LoadError
|
39
|
-
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
40
|
-
end
|
data/templates/Vagrantfile.erb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- mode: ruby -*-
|
2
|
-
# vi: set ft=ruby :
|
3
|
-
|
4
|
-
Vagrant.configure('2') do |config|
|
5
|
-
config.vm.hostname = '<%= cookbook_name %>'
|
6
|
-
config.vm.box = 'ubuntu-12.04'
|
7
|
-
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_#{config.vm.box}_chef-provisionerless.box"
|
8
|
-
config.omnibus.chef_version = 'latest'
|
9
|
-
config.berkshelf.enabled = true
|
10
|
-
|
11
|
-
config.vm.provision :chef_solo do |chef|
|
12
|
-
chef.json = {
|
13
|
-
}
|
14
|
-
|
15
|
-
chef.run_list = [
|
16
|
-
'recipe[<%= cookbook_name %>::default]'
|
17
|
-
]
|
18
|
-
end
|
19
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
|
3
|
-
require_relative 'spec_helper'
|
4
|
-
|
5
|
-
describe '<%= cookbook_name %>::default' do
|
6
|
-
before { stub_resources }
|
7
|
-
describe 'ubuntu' do
|
8
|
-
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
|
9
|
-
|
10
|
-
it 'writes some chefspec code' do
|
11
|
-
pending 'todo'
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
require 'chefspec'
|
3
|
-
require 'chefspec/berkshelf'
|
4
|
-
require 'chef/application'
|
5
|
-
|
6
|
-
::LOG_LEVEL = :fatal
|
7
|
-
::UBUNTU_OPTS = {
|
8
|
-
platform: 'ubuntu',
|
9
|
-
version: '12.04',
|
10
|
-
log_level: ::LOG_LEVEL
|
11
|
-
}
|
12
|
-
::CHEFSPEC_OPTS = {
|
13
|
-
log_level: ::LOG_LEVEL
|
14
|
-
}
|
15
|
-
|
16
|
-
def stub_resources
|
17
|
-
end
|
18
|
-
|
19
|
-
at_exit { ChefSpec::Coverage.report! }
|