meez 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +4 -8
- data/Gemfile +0 -14
- data/README.md +50 -32
- data/bin/meez +4 -5
- data/lib/meez/meez.rb +5 -6
- data/meez.gemspec +1 -1
- data/templates/.drone.yml.erb +3 -3
- data/templates/.rubocop.yml.erb +0 -6
- data/templates/Rakefile.erb +58 -26
- data/templates/chefspec/default_spec.rb.erb +1 -1
- data/templates/serverspec/default_spec.rb.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7724639e6e8040d470164acd8fb484375a2cd024
|
4
|
+
data.tar.gz: 672f53c838bee77c8bc7af2273d6ba07c0fdb31d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2309e47b1f3aee29d38dd700f2e51fc964e3dde4df268d892323ef8f2c56ae90b9d41d81c6d5d5f3397c5438b2f82ee318ed931acc81eedf1b8286e1ca1d69ed
|
7
|
+
data.tar.gz: fa76d5a3da6e8f6f76725b8836ea6d154ba35d1bedb0cd2d53eda075934c62140ddbf0097e519f8def95d292ca34c049e5c57c0ec1ce0d62ccc35da7b726fd8d
|
data/Dockerfile
CHANGED
@@ -2,19 +2,15 @@ FROM racker/precise-with-updates
|
|
2
2
|
|
3
3
|
RUN apt-get -yqq update && apt-get -yqq install curl build-essential libxml2-dev libxslt-dev git autoconf wget python-pip
|
4
4
|
|
5
|
-
RUN wget -q -O /tmp/chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.1
|
5
|
+
RUN wget -q -O /tmp/chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.2.1-1_amd64.deb \
|
6
6
|
&& dpkg -i /tmp/chefdk.deb \
|
7
7
|
&& rm /tmp/chefdk.deb
|
8
8
|
|
9
|
-
RUN wget -q -O /tmp/vagrant.deb http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.
|
9
|
+
RUN wget -q -O /tmp/vagrant.deb http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.6.5_x86_64.deb \
|
10
10
|
&& dpkg -i /tmp/vagrant.deb \
|
11
|
-
&& rm /tmp/vagrant.deb
|
11
|
+
&& rm /tmp/vagrant.deb
|
12
12
|
|
13
13
|
RUN pip install swiftly awscli
|
14
14
|
|
15
|
-
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
|
15
|
+
ENV PATH /opt/chefdk/bin:/opt/chefdk/embedded/bin:/root/.chefdk/gem/ruby/2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
16
16
|
ENV USE_SYSTEM_GECODE 1
|
17
|
-
|
18
|
-
ADD Gemfile /tmp/Gemfile
|
19
|
-
|
20
|
-
RUN cd /tmp && bundle install && rm Gemfile*
|
data/Gemfile
CHANGED
@@ -1,20 +1,6 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'berkshelf', '= 3.1.3'
|
4
|
-
gem 'chef', '> 11.12.0'
|
5
3
|
gem 'rake', '>= 10.3'
|
6
4
|
gem 'rubocop', '= 0.23'
|
7
|
-
gem 'foodcritic', '>= 3.0'
|
8
|
-
gem 'chefspec', '> 4'
|
9
|
-
gem 'serverspec', '>= 1.10'
|
10
5
|
gem 'guard', '>= 2.6'
|
11
6
|
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/README.md
CHANGED
@@ -15,6 +15,17 @@ Install
|
|
15
15
|
|
16
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
17
|
|
18
|
+
You may need to install `gecode` on your system: http://www.gecode.org/download.html
|
19
|
+
|
20
|
+
for OSX I did
|
21
|
+
|
22
|
+
```
|
23
|
+
$ cd $( brew --prefix )
|
24
|
+
$ git checkout 3c5ca25 Library/Formula/gecode.rb
|
25
|
+
$ brew install gecode
|
26
|
+
$ brew link gecode
|
27
|
+
```
|
28
|
+
|
18
29
|
Official
|
19
30
|
----------
|
20
31
|
|
@@ -22,13 +33,6 @@ as of version `0.2.0` this is offered as a `chefdk` plugin.
|
|
22
33
|
|
23
34
|
`chef gem install meez`
|
24
35
|
|
25
|
-
Unofficial
|
26
|
-
-------------
|
27
|
-
|
28
|
-
Your results may vary using it outside of `chefdk`
|
29
|
-
|
30
|
-
`gem install meez`
|
31
|
-
|
32
36
|
|
33
37
|
Usage
|
34
38
|
=====
|
@@ -49,36 +53,39 @@ Options
|
|
49
53
|
|
50
54
|
```
|
51
55
|
$ meez --cookbook-path /tmp --copyright Foo -I apachev2 -m foo@bah.com test
|
56
|
+
chef exec meez -o . test
|
52
57
|
* Initializing Cookbook
|
53
58
|
** Creating cookbook test
|
54
59
|
** Creating README for cookbook: test
|
55
60
|
** Creating CHANGELOG for cookbook: test
|
56
61
|
** Creating metadata for cookbook: test
|
57
|
-
|
58
|
-
|
62
|
+
Rewriting metadata.rb
|
63
|
+
Rewriting recipes/default.rb
|
59
64
|
* Initializing Berkshelf
|
60
|
-
create
|
61
|
-
create
|
62
|
-
create /
|
63
|
-
|
64
|
-
create
|
65
|
+
create test/Berksfile
|
66
|
+
create test/Thorfile
|
67
|
+
create test/chefignore
|
68
|
+
create test/.gitignore
|
69
|
+
create test/Gemfile
|
65
70
|
* Initializing Vagrantfile
|
71
|
+
Creating ./test/Vagrantfile from template
|
66
72
|
* Initializing Knife
|
67
|
-
|
73
|
+
adding chef gem to Gemfile
|
68
74
|
* Initializing Rakefile
|
69
|
-
|
75
|
+
Creating ./test/Rakefile from template
|
76
|
+
adding rake gem to Gemfile
|
70
77
|
* Initializing Rubocop
|
71
|
-
|
78
|
+
Creating ./test/.rubocop.yml from template
|
79
|
+
adding rubocop gem to Gemfile
|
72
80
|
* Initializing Food Critic
|
73
|
-
|
81
|
+
adding foodcritic gem to Gemfile
|
74
82
|
* Initializing Chef Spec
|
75
|
-
|
76
|
-
|
77
|
-
|
83
|
+
Creating ./test/test/unit/spec/spec_helper.rb from template
|
84
|
+
Creating ./test/test/unit/spec/default_spec.rb from template
|
85
|
+
adding chefspec gem to Gemfile
|
78
86
|
* Initializing Server Spec
|
79
|
-
|
80
|
-
|
81
|
-
Append Gemfile
|
87
|
+
Creating ./test/test/integration/default/serverspec/spec_helper.rb from template
|
88
|
+
Creating ./test/test/integration/default/serverspec/default_spec.rb from template
|
82
89
|
* Initializing Test Kitchen
|
83
90
|
create .kitchen.yml
|
84
91
|
append Rakefile
|
@@ -89,25 +96,36 @@ $ meez --cookbook-path /tmp --copyright Foo -I apachev2 -m foo@bah.com test
|
|
89
96
|
append Gemfile
|
90
97
|
append Gemfile
|
91
98
|
You must run `bundle install' to fetch any new gems.
|
99
|
+
Creating ./test/.kitchen.yml from template
|
100
|
+
* Initializing Guard
|
101
|
+
Creating ./test/Guardfile from template
|
102
|
+
adding guard gem to Gemfile
|
103
|
+
adding guard-rubocop gem to Gemfile
|
104
|
+
adding guard-foodcritic gem to Gemfile
|
105
|
+
* Initializing Drone
|
106
|
+
Creating ./test/.drone.yml from template
|
107
|
+
* Initializing Docker
|
108
|
+
Creating ./test/Dockerfile from template
|
92
109
|
Cookbook test created successfully
|
93
110
|
Next steps...
|
94
|
-
$ cd
|
111
|
+
$ cd ./test
|
95
112
|
$ export USE_SYSTEM_GECODE=1
|
96
|
-
$
|
97
|
-
$
|
98
|
-
|
113
|
+
$ chef exec rake prepare
|
114
|
+
$ chef exec rake test
|
99
115
|
$ cd /tmp/test
|
100
116
|
$ export USE_SYSTEM_GECODE=1
|
101
|
-
$
|
102
|
-
|
103
|
-
Fetching
|
117
|
+
$ chef exec rake prepare
|
118
|
+
chef exec bundle install --path .bundle
|
119
|
+
Fetching gem metadata from https://rubygems.org/.......
|
120
|
+
Fetching additional metadata from https://rubygems.org/..
|
104
121
|
Resolving dependencies...
|
122
|
+
Installing rake (10.3.2)
|
105
123
|
...
|
106
124
|
...
|
107
125
|
Your bundle is complete!
|
108
126
|
$ bundle exec berks install
|
109
127
|
Using test (0.1.0) from metadata
|
110
|
-
$
|
128
|
+
$ chef exec rake -T
|
111
129
|
rake integration # Run Test Kitchen integration tests
|
112
130
|
rake kitchen:all # Run all test instances
|
113
131
|
rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance
|
data/bin/meez
CHANGED
@@ -11,7 +11,7 @@ options = {
|
|
11
11
|
}
|
12
12
|
|
13
13
|
opt_parser = OptionParser.new do |opt|
|
14
|
-
opt.banner = 'Usage: meez [options] <cookbook name>'
|
14
|
+
opt.banner = 'Usage: chef exec meez [options] <cookbook name>'
|
15
15
|
opt.separator ''
|
16
16
|
opt.separator 'Options'
|
17
17
|
opt.on('-o', '--cookbook-path PATH', 'The directory where the cookbook will be created') do |path|
|
@@ -35,7 +35,7 @@ opt_parser = OptionParser.new do |opt|
|
|
35
35
|
end
|
36
36
|
opt.on('-v', '--version', 'version') do
|
37
37
|
options[:version] = true
|
38
|
-
puts 'meez version 0.2.
|
38
|
+
puts 'meez version 0.2.7'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -50,9 +50,8 @@ unless options[:help] || options[:version]
|
|
50
50
|
puts 'Next steps...'
|
51
51
|
puts " $ cd #{File.join(options[:path], cookbook_name)}"
|
52
52
|
puts ' $ export USE_SYSTEM_GECODE=1'
|
53
|
-
puts ' $
|
54
|
-
puts ' $
|
55
|
-
puts ' $ bundle exec rake'
|
53
|
+
puts ' $ chef exec rake prepare'
|
54
|
+
puts ' $ chef exec rake test'
|
56
55
|
else
|
57
56
|
puts 'Need to specify a cookbook'
|
58
57
|
puts opt_parser
|
data/lib/meez/meez.rb
CHANGED
@@ -82,7 +82,7 @@ class Meez
|
|
82
82
|
skip_vagrant: true
|
83
83
|
).invoke_all
|
84
84
|
contents = File.read(File.join(path, 'Gemfile'))
|
85
|
-
newgemfile = contents.gsub("\ngem 'berkshelf'\n", "\ngem 'berkshelf', '
|
85
|
+
newgemfile = contents.gsub("\ngem 'berkshelf'\n", "\ngem 'berkshelf', '> 3.1'\n")
|
86
86
|
File.open(File.join(path, 'Gemfile'), 'w') { |f| f.write(newgemfile) }
|
87
87
|
end
|
88
88
|
|
@@ -111,7 +111,7 @@ class Meez
|
|
111
111
|
write_template('chefspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
|
112
112
|
write_template('chefspec/default_spec.rb.erb', spec_path, cookbook_name, options)
|
113
113
|
gitignore(path, '.coverage/*')
|
114
|
-
add_gem(path, 'chefspec'
|
114
|
+
add_gem(path, 'chefspec')
|
115
115
|
end
|
116
116
|
|
117
117
|
def self.init_rakefile(cookbook_name, options)
|
@@ -125,19 +125,19 @@ class Meez
|
|
125
125
|
puts '* Initializing Rubocop'
|
126
126
|
path = File.join(options[:path], cookbook_name)
|
127
127
|
write_template('.rubocop.yml.erb', path, cookbook_name, options)
|
128
|
-
add_gem(path, 'rubocop'
|
128
|
+
add_gem(path, 'rubocop')
|
129
129
|
end
|
130
130
|
|
131
131
|
def self.init_knife(cookbook_name, options)
|
132
132
|
puts '* Initializing Knife'
|
133
133
|
path = File.join(options[:path], cookbook_name)
|
134
|
-
add_gem(path, 'chef', '> 11
|
134
|
+
add_gem(path, 'chef', '> 11')
|
135
135
|
end
|
136
136
|
|
137
137
|
def self.init_foodcritic(cookbook_name, options)
|
138
138
|
puts '* Initializing Food Critic'
|
139
139
|
path = File.join(options[:path], cookbook_name)
|
140
|
-
add_gem(path, 'foodcritic'
|
140
|
+
add_gem(path, 'foodcritic')
|
141
141
|
end
|
142
142
|
|
143
143
|
def self.init_serverspec(cookbook_name, options)
|
@@ -147,7 +147,6 @@ class Meez
|
|
147
147
|
FileUtils.mkdir_p(spec_path)
|
148
148
|
write_template('serverspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
|
149
149
|
write_template('serverspec/default_spec.rb.erb', spec_path, cookbook_name, options)
|
150
|
-
add_gem(path, 'serverspec', '>= 1.10')
|
151
150
|
end
|
152
151
|
|
153
152
|
def self.init_guard(cookbook_name, options)
|
data/meez.gemspec
CHANGED
data/templates/.drone.yml.erb
CHANGED
data/templates/.rubocop.yml.erb
CHANGED
data/templates/Rakefile.erb
CHANGED
@@ -1,40 +1,72 @@
|
|
1
1
|
# Encoding: utf-8
|
2
|
-
|
2
|
+
|
3
|
+
namespace :prepare do
|
4
|
+
|
5
|
+
desc 'Install ChefDK'
|
6
|
+
task :chefdk do
|
7
|
+
begin
|
8
|
+
gem 'chef-dk', '0.2.1'
|
9
|
+
rescue Gem::LoadError
|
10
|
+
puts 'ChefDK not found. Installing it for you...'
|
11
|
+
sh %{wget -O /tmp/meez_chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.2.1-1_amd64.deb}
|
12
|
+
sh %{sudo dpkg -i /tmp/meez_chefdk.deb}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
task :bundle do
|
17
|
+
if ENV['CI']
|
18
|
+
sh %{chef exec bundle install --path=.bundle --jobs 1 --retry 3 --verbose}
|
19
|
+
else
|
20
|
+
sh %{chef exec bundle install --path .bundle}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
task :berks do
|
25
|
+
sh %{chef exec berks install}
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Install required Gems and Cookbooks'
|
31
|
+
task prepare: ['prepare:bundle', 'prepare:berks']
|
3
32
|
|
4
33
|
namespace :style do
|
5
|
-
|
6
|
-
|
7
|
-
|
34
|
+
task :rubocop do
|
35
|
+
sh %{chef exec rubocop}
|
36
|
+
end
|
8
37
|
|
9
|
-
|
10
|
-
|
11
|
-
|
38
|
+
task :foodcritic do
|
39
|
+
sh %{chef exec foodcritic .}
|
40
|
+
end
|
12
41
|
end
|
13
42
|
|
14
43
|
desc 'Run all style checks'
|
15
|
-
task style: ['style:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Kitchen.logger = Kitchen.default_file_logger
|
21
|
-
Kitchen::Config.new.instances.each do |instance|
|
22
|
-
instance.test(:always)
|
44
|
+
task style: ['style:foodcritic', 'style:rubocop']
|
45
|
+
|
46
|
+
namespace :integration do
|
47
|
+
task :kitchen do
|
48
|
+
sh %{chef exec kitchen test}
|
23
49
|
end
|
24
50
|
end
|
25
51
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
52
|
+
task integration: ['integration:kitchen']
|
53
|
+
|
54
|
+
namespace :unit do
|
55
|
+
task :chefspec do
|
56
|
+
sh %{chef exec rspec test/unit/spec}
|
57
|
+
end
|
30
58
|
end
|
31
59
|
|
60
|
+
desc 'Run all unit tests'
|
61
|
+
task unit: ['unit:chefspec']
|
62
|
+
task spec: ['unit']
|
63
|
+
|
64
|
+
# Run all tests
|
65
|
+
desc 'Run all tests'
|
66
|
+
task test: ['style', 'unit', 'integration']
|
67
|
+
|
32
68
|
# The default rake task should just run it all
|
33
|
-
|
69
|
+
desc 'Install required Gems and Cookbook then run all tests'
|
70
|
+
task default: ['prepare', 'test' ]
|
71
|
+
|
34
72
|
|
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
|