Giter Club home page Giter Club logo

meez's Introduction

Meez

About

Meez is slang for mise en place

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.

Meez will create an opinionated chef cookbook skeleton complete with testing suite.

Install

Setting the environment variable USE_SYSTEM_GECODE=1 will help speed up builds by using the system gecode rather than compiling it from scratch.

You may need to install gecode on your system: http://www.gecode.org/download.html

for OSX I did

$ cd $( brew --prefix )
$ git checkout 3c5ca25 Library/Formula/gecode.rb
$ brew install gecode
$ brew link gecode

Official

as of version 0.2.0 this is offered as a chefdk plugin.

chef gem install meez

Usage

Usage: meez [options] <cookbook name>

Options
    -o, --cookbook-path USERNAME     The directory where the cookbook will be created
    -C, --copyright COPYRIGHT_HOLDER The  name  of  the  copyright holder.
    -I, --license LICENSE            The type of license under which a cookbook is distributed: apachev2, gplv2, gplv3, mit, or none (default).
    -m, --email EMAIL                The  email  address  for the individual who maintains the cookbook.
    -d, --kitchen-driver DRIVER      The driver which use test-kitchen for creating platform instances: vagrant (default), docker
    -h, --help                       help

Example

$ meez --cookbook-path /tmp --copyright Foo -I apachev2 -m [email protected] test
chef exec meez -o . test
* Initializing Cookbook
** Creating cookbook test
** Creating README for cookbook: test
** Creating CHANGELOG for cookbook: test
** Creating metadata for cookbook: test
  Rewriting metadata.rb
  Rewriting recipes/default.rb
* Initializing Berkshelf
      create  test/Berksfile
      create  test/Thorfile
      create  test/chefignore
      create  test/.gitignore
      create  test/Gemfile
* Initializing Vagrantfile
  Creating ./test/Vagrantfile from template
* Initializing Knife
adding chef gem to Gemfile
* Initializing Rakefile
  Creating ./test/Rakefile from template
adding rake gem to Gemfile
* Initializing Rubocop
  Creating ./test/.rubocop.yml from template
adding rubocop gem to Gemfile
* Initializing Food Critic
adding foodcritic gem to Gemfile
* Initializing Chef Spec
  Creating ./test/test/unit/spec/spec_helper.rb from template
  Creating ./test/test/unit/spec/default_spec.rb from template
adding chefspec gem to Gemfile
* Initializing Server Spec
  Creating ./test/test/integration/default/serverspec/spec_helper.rb from template
  Creating ./test/test/integration/default/serverspec/default_spec.rb from template
* Initializing Test Kitchen
      create  .kitchen.yml
      append  Rakefile
      append  Thorfile
       exist  test/integration/default
      append  .gitignore
      append  .gitignore
      append  Gemfile
      append  Gemfile
You must run `bundle install' to fetch any new gems.
  Creating ./test/.kitchen.yml from template
* Initializing Guard
  Creating ./test/Guardfile from template
adding guard gem to Gemfile
adding guard-rubocop gem to Gemfile
adding guard-foodcritic gem to Gemfile
* Initializing Drone
  Creating ./test/.drone.yml from template
* Initializing Docker
  Creating ./test/Dockerfile from template
Cookbook test created successfully
Next steps...
  $ cd ./test
  $ export USE_SYSTEM_GECODE=1
  $ chef exec rake prepare
  $ chef exec rake test
$ cd /tmp/test
$ export USE_SYSTEM_GECODE=1
$ chef exec rake prepare
chef exec bundle install --path .bundle
Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.3.2)
...
...
Your bundle is complete!
It was installed into ./.bundle
chef exec berks install
Resolving cookbook dependencies...
Fetching 'test' from source at .
Fetching cookbook index from https://supermarket.getchef.com...
Using test (0.1.0) from source at .
$ chef exec rake -T
rake kitchen:all                  # Run all test instances
rake kitchen:default-ubuntu-1204  # Run default-ubuntu-1204 test instance
rake prepare                      # Install required Gems and Cookbooks
rake prepare:chefdk               # Install ChefDK
rake style                        # Run all style checks
rake unit                         # Run all unit tests

Contributing

e.g.

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors:

Paul Czarkowski - [email protected]

License:

Copyright 2014 Paul Czarkowski, Rackspace Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

meez's People

Contributors

arborlab avatar behemphi avatar flaccid avatar paulczar avatar rberger avatar rosstimson avatar while1eq1 avatar wickett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meez's Issues

Generated cookbook's gemfile has unresolvable dependencies in ChefDK 0.2.0

I have what I think is a pretty vanilla ChefDK 0.2.0 installation.

$ eval "$(chef shell-init bash)"
$ meez --version
meez version 0.2.2
$ chef --version
Chef Development Kit Version: 0.2.0
$ which ruby ; which gem ; which bundle
/opt/chefdk/embedded/bin/ruby
/opt/chefdk/embedded/bin/gem
/opt/chefdk/embedded/bin/bundle

I ran bundle install to see if the cookbook structure generated by meez had any dependencies that weren't provided by ChefDK. That resilted in the following error:

$ bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "rspec":
  In Gemfile:
    serverspec (>= 1.10) ruby depends on
      rspec (~> 2.99) ruby

    chefspec (> 4) ruby depends on
      rspec (3.0.0)

Bundler could not find compatible versions for gem "foodcritic":
  In Gemfile:
    guard-foodcritic (>= 1.0.2) ruby depends on
      foodcritic (< 4.0, >= 1.3) ruby

    foodcritic (4.0.0)

Options to skip initializing some services

Currently meez always initializes every utility it knows about, i.e.

  def self.init(cookbook_name, options)
    init_cookbook(cookbook_name, options)
    init_berkshelf(cookbook_name, options)
    init_vagrant(cookbook_name, options)
    init_knife(cookbook_name, options)
    init_rakefile(cookbook_name, options)
    init_rubocop(cookbook_name, options)
    init_foodcritic(cookbook_name, options)
    init_chefspec(cookbook_name, options)
    init_serverspec(cookbook_name, options)
    init_kitchenci(cookbook_name, options)
    init_guard(cookbook_name, options)
    init_drone(cookbook_name, options)
    init_docker(cookbook_name, options)
  end

It would be nice if there were options to disable utilities the cookbook developer does not intend to use. For example, --skip=docker,drone or --skip-docker --skip-drone to prevent initializing docker and drone.

Vagrantfile.erb.. how about kitchen.yml.erb?

I'm now using meez installed through chef from chefdk. (v 0.2.5). I modified the Vagrantfile.erb in the templates dir of the gem so I get centos-6.4 instead of ubuntu. I would also like to do the same for the .kitchen.yml file however I don't see a matching template erb file like the Vagrantfile.erb for Vagrantfile. Is there a way to set this for .kitchen.yml automatically in meez? If not.. how about about a feature request like a parameter? ... 'meez --os centos-6.4' or perhaps in a meez defaults file say in ~/.meez file where one can set other defaults not just the OS for instance?

Could not find meez among gems

I've set up ChefDK and installed meez using chef gem install meez, but when I try to run the meez command I'm getting:

/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'meez' (>= 0) among 59 total gem(s) (Gem::LoadError)
    from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /home/justin/.chefdk/gem/ruby/2.1.0/bin/meez:22:in `<main>'

My PATH:

/home/justin/.chefdk/gem/ruby/2.1.0/bin:/home/justin/.rvm/gems/ruby-2.1.2/bin:/home/justin/.rvm/gems/ruby-2.1.2@global/bin:/home/justin/.rvm/rubies/ruby-2.1.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/justin/.rvm/bin:/home/justin/.rvm/bin

OS: Ubuntu 14.04

Match Vagrantfile with kitchen

So the default Vagrantfile wants to use centos, but kitchen is set to use Ubuntu 12.04 (which is what I use). It would be neat to get these in sync. Also noticed that the kitchen ubuntu box is behind on its virtual box guest additions.

BTW, love meez as it speaks to my OCD side.

ruby error in chefspec part of strainer test

When I run bundle exec strainer test, I get this error:

/Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/json-1.7.7/lib/json/common.rb:285:in `generate': 810: NaN not allowed in JSON (JSON::GeneratorError)

Here's the chefspec excerpt:

chefspec             | bundle exec rspec /Users/ascammon/dev/meez/tmp/test/test/unit/spec
chefspec             | *
chefspec             | Pending:
chefspec             | test::default ubuntu writes some chefspec code
chefspec             | # todo
chefspec             | # /Users/ascammon/dev/meez/tmp/test/test/unit/spec/default_spec.rb:10
chefspec             | Finished in 0.03139 seconds
chefspec             | 1 example, 0 failures, 1 pending
chefspec             | /Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/json-1.7.7/lib/json/common.rb:285:in `generate': 810: NaN not allowed in JSON (JSON::GeneratorError)
chefspec             | from /Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/json-1.7.7/lib/json/common.rb:285:in `pretty_generate'
chefspec             | from /Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/chefspec-3.1.4/lib/chefspec/coverage.rb:88:in `block in report!'
chefspec             | from /Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/chefspec-3.1.4/lib/chefspec/coverage.rb:87:in `open'
chefspec             | from /Users/ascammon/.rvm/gems/ruby-1.9.3-p327@meez/gems/chefspec-3.1.4/lib/chefspec/coverage.rb:87:in `report!'
chefspec             | from /private/Users/ascammon/dev/meez/tmp/test/test/unit/spec/spec_helper.rb:19:in `block in <top (required)>'
chefspec             | Terminated with a non-zero exit status. Strainer assumes this is a failure.
chefspec             | FAILURE!

I'll try and take a look at it later, but it's late and I just wanted to report it.

chefdk

Not really a technical issue but now that chefdk is out am i supposed to choose one or the other? It seems as though they both (meez and chefdk) do the same thing for the most part.

should rubocop test error out?

With the basic install, rubocop is throwing this error

rubocop              | bundle exec rubocop test
rubocop              | Inspecting 6 files
rubocop              | undefined method `color' for ".":String
rubocop              | Terminated with a non-zero exit status. Strainer assumes this is a failure.
rubocop              | FAILURE!

Is this just an example of failing test, or should this be fixed?

configuration file?

Someone else already posted a similar comment under milestones. I just wanted to make sure the ability to change the platfrom in vagrant and test-kitchen from say the current ubuntu to centos would be good to have as part of a config file.

roadmap - usage of strainer

Hi, I've been using meez for the setup of the last cookbook I wrote, and just wanted to bring to your attention that Seth Vargo, the author of strainer is no longer recommending or supporting using strainer to test individual cookbook repo's (just for testing cookbooks kept together in a chef-repo situation with multiple cookbooks in it).

Discussion was at customink/strainer#55 and in fact, removing strainer didn't mean giving up the integration with the given default tools used in meez, the same was achieved with a single Rakefile. See https://github.com/opscode-cookbooks/jenkins/blob/master/Rakefile for an example setup.

It may be worth moving to a similar setup rather than get left behind - in fact I already encountered some issues with the strainer integration (in above ticket)

New cookbook created from meez, 30 offenses detected

$ chef exec rake test
chef exec foodcritic .

chef exec rubocop
Inspecting 11 files
.CCC.....CC

Offenses:

Guardfile:5:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{.+\.rb$})
        ^^^^^^^^^^^
Guardfile:6:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Guardfile:10:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{attributes/.+\.rb$})
        ^^^^^^^^^^^^^^^^^^^^^^
Guardfile:11:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{providers/.+\.rb$})
        ^^^^^^^^^^^^^^^^^^^^^
Guardfile:12:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{recipes/.+\.rb$})
        ^^^^^^^^^^^^^^^^^^^
Guardfile:13:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{resources/.+\.rb$})
        ^^^^^^^^^^^^^^^^^^^^^
Guardfile:14:9: C: Use %r only for regular expressions matching more than 1 '/' character.
  watch(%r{metadata\.rb$})
        ^^^^^^^^^^^^^^^^^
Guardfile:15:4: C: Final newline missing.
end

metadata.rb:2:5: C: Put one space between the method name and the first argument.
name             'roundcube'
    ^^^^^^^^^^^^^
metadata.rb:3:11: C: Put one space between the method name and the first argument.
maintainer       'Chris Fordham'
          ^^^^^^^
metadata.rb:5:8: C: Put one space between the method name and the first argument.
license          'Apache 2.0'
       ^^^^^^^^^^
metadata.rb:6:12: C: Put one space between the method name and the first argument.
description      'Installs/Configures roundcube'
           ^^^^^^
metadata.rb:8:8: C: Put one space between the method name and the first argument.
version          '0.1.0'
       ^^^^^^^^^^
Rakefile:11:10: C: %-literals should be delimited by ( and )
      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}
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:11:135: C: Line is too long. [135/80]
      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}
                                                                                                                                      ^
Rakefile:12:10: C: %-literals should be delimited by ( and )
      sh %{sudo dpkg -i /tmp/meez_chefdk.deb}
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:18:10: C: %-literals should be delimited by ( and )
      sh %{chef exec bundle install --path=.bundle --jobs 1 --retry 3 --verbose}
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:20:10: C: %-literals should be delimited by ( and )
      sh %{chef exec bundle install --path .bundle}
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:25:8: C: %-literals should be delimited by ( and )
    sh %{chef exec berks install}
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:35:8: C: %-literals should be delimited by ( and )
    sh %{chef exec rubocop}
       ^^^^^^^^^^^^^^^^^^^^
Rakefile:39:8: C: %-literals should be delimited by ( and )
    sh %{chef exec foodcritic .}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:48:8: C: %-literals should be delimited by ( and )
    sh %{chef exec kitchen test}
       ^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:56:8: C: %-literals should be delimited by ( and )
    sh %{chef exec rspec test/unit/spec}
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Rakefile:70:33: C: Space inside square brackets detected.
task default: ['prepare', 'test' ]
                                ^
Rakefile:72:1: C: Extra blank line detected.
Rakefile:73:1: C: Extra blank line detected.
Rakefile:78:8: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
  puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Thorfile:11:8: C: Prefer single-quoted strings when you don't need string interpolation or special symbols.
  puts ">>>>> Kitchen gem not loaded, omitting tasks" unless ENV['CI']
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Vagrantfile:7:93: C: Line is too long. [133/80]
  config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_#{config.vm.box}_chef-provisionerless.box"
                                                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Vagrantfile:16:9: C: Use 2 spaces for indentation in an array, relative to the start of the line where the left bracket is.
        'recipe[roundcube::default]'
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

11 files inspected, 30 offenses detected
rake aborted!
Command failed with status (1): [chef exec rubocop...]
/Users/chris.fordham/src/github/xhost-cookbooks/roundcube/Rakefile:35:in `block (2 levels) in <top (required)>'
Tasks: TOP => test => style => style:rubocop
(See full trace by running task with --trace)

On latest OS X (10.10.1) so ruby 2.0.0p481. Would these be considered bugs which we can look at fixing in meez?

.kitchen.yml for Mac OS X should set use_sudo: false for docker driver

Mac OSX that has docker installed via brew (and maybe others?) expect docker command to be run as the user and not with sudo. So the kitchen driver needs to have the line use_sudo: false added as in:


---
driver:
  name: docker
  provision_command: curl -L http://www.opscode.com/chef/install.sh | bash
  use_sudo: false

If you don't do that, when you even run rake -T you will get all sorts of errors from the line Kitchen::RakeTasks.new in the Rakefile cause it trys to do sudo -E docker > /dev/null and fails spewing error messages.

Rake task complaining about vagrant gem missing

~/src/cookbooks/meez_cookbook (master)*$ bundle exec rake
rake aborted!
Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT: 
STDERR: /usr/local/var/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/bundler-1.5.2/lib/bundler/rubygems_integration.rb:240:in `block in replace_gem': vagrant is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
    from /usr/local/var/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/bin/vagrant:22:in `<main>'
---- End output of vagrant --version ----
Ran vagrant --version returned 1
/Users/mstratton/src/cookbooks/meez_cookbook/Rakefile:37:in `new'
/Users/mstratton/src/cookbooks/meez_cookbook/Rakefile:37:in `<top (required)>'

If vagrant is no longer a gem, why would I need to add it to the gemfile?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.