Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

ruby_pkg (5) Versions 0.4.0

Builds a ruby package using ruby_build and fpm

Policyfile
Berkshelf
Knife
cookbook 'ruby_pkg', '~> 0.4.0', :supermarket
cookbook 'ruby_pkg', '~> 0.4.0'
knife supermarket install ruby_pkg
knife supermarket download ruby_pkg
README
Dependencies
Quality 17%

ruby_pkg

Build Status
Dependency Status

Table of Contents

Description

A Chef cookbook with knife-solo and Vagrant setups for building and packaging a specified Ruby version.

Requirements

Should work on Debian and Enterprise Linux based distributions. Other platforms (that ruby_build and fpm support) should be possible to add. Please open an issue or pull request if interested.

Requires ruby_build and fpm-tng community cookbooks.

Usage

The easiest way to build the Ruby package is by using the included knife-solo or Vagrant setup. You can of course use the cookbook also directly by adding it to run_list or by including it in your own cookbooks.

To use knife-solo or Vagrant you need to use the full source repository version. You can download and extract a tarball release or clone the git repository:

    $ git clone https://github.com/reaktor/chef-ruby_pkg.git ruby_pkg
    $ cd ruby_pkg

knife-solo

Requirements

  1. Install Ruby (1.9.3 or later) and Bundler
  2. Install knife-solo and dependencies:

    $ bundle install --without development:test
    

Building with knife-solo

  1. Copy ./nodes/example.json to for example ./nodes/myruby.json and edit it to match your wishes. See Attributes for possible options.
  2. Bootstrap the server. Installs Chef and other knife-solo requirements and then builds and packages the specified Ruby version:

    $ bundle exec knife solo bootstrap  nodes/myruby.json
    

    You can also use knife-ec2, knife-digital_ocean, etc. For example:

    $ gem install knife-ec2
    $ knife ec2 server create --node-name=myruby ...
    # note the FQDN/IP for next phase
    

    If the server is already prepared, you can run only the converge phase:

    $ bundle exec knife solo cook  nodes/myruby.json
    
  3. Fetch the package from the server. For example:

    $ scp :/tmp/debian-7.0_ruby-1.9.3-p448-1_amd64.deb pkg/
    

Vagrant

Install Vagrant environment

  1. Install Vagrant v1.2 or later
  2. Install needed Vagrant plugins:

    $ vagrant plugin install vagrant-berkshelf
    $ vagrant plugin install vagrant-omnibus
    
  3. Add your favorite Vagrant box, for example:

    $ vagrant box add "ubuntu-12.04" "http://files.vagrantup.com/precise64.box"
    

Building with Vagrant

Spin up the box to build and package a specified Ruby version:

$ VERSION="2.0.0-p247" BOX="ubuntu-12.04" vagrant up

The package will be created to pkg directory.

Environment variables for Vagrant

  • $BOX - The Vagrant box name. Defaults to "squeeze-6.0".
  • $DEBUG - If set, enable debug logging of the Chef run.
  • $VERSION - The Ruby version to package. Passed to ruby_build. Defaults to "1.9.3-p448"
  • $ITERATION - The package iteration version number. Passed to fpm. Defaults to 1.
  • $MAINTAINER - The (optional) package maintainer. Passed to fpm.

Recipes

  • default - Includes other recipes to build and package the specified Ruby version.
  • build - Builds the specified Ruby version.
  • package - Makes a package from the specified (and formerly built) Ruby version.

Attributes

  • node['ruby_pkg']['ruby_version'] - The Ruby version to build. Defaults to "1.9.3-p448".
  • node['ruby_pkg']['iteration'] - The iteration/revision number of the package. Defaults to 1.
  • node['ruby_pkg']['base_dir'] - The base directory where the Ruby versions will be installed. Defaults to "/usr/local/ruby".
  • node['ruby_pkg']['pkg_dir'] - The directory where the package will be built. Defaults to "/tmp".
  • node['ruby_pkg']['maintainer'] - The optional maintainer field. Defaults to nil.

License and Author

Author:: Teemu Matilainen <teemu.matilainen@reaktor.fi>

Copyright © 2013, Reaktor Innovations Oy

Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE).

Dependent cookbooks

fpm-tng ~> 0.1.6
ruby_build ~> 0.6

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.4.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.4.0 failed this metric

FC064: Ensure issues_url is set in metadata: ruby_pkg/metadata.rb:1
FC065: Ensure source_url is set in metadata: ruby_pkg/metadata.rb:1
FC066: Ensure chef_version is set in metadata: ruby_pkg/metadata.rb:1
FC069: Ensure standardized license defined in metadata: ruby_pkg/metadata.rb:1
FC104: Use the :run action in ruby_block instead of :create: ruby_pkg/recipes/_fpm_gemhome.rb:31
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.4.0 passed this metric

Testing File Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number