cookbook 'ruby_pkg', '= 0.2.0'
ruby_pkg (5) Versions 0.2.0 Follow3
Builds a ruby package using ruby_build and fpm
cookbook 'ruby_pkg', '= 0.2.0', :supermarket
knife supermarket install ruby_pkg
knife supermarket download ruby_pkg
ruby_pkg
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 all Debian based Linux distributions. Support for some other platforms (that ruby_build and fpm support) is planned. Please open an issue or pull request if interested.
Requires ruby_build and fpm-tng community cookbooks.
Usage
This cookbook is intended to be used with the included knife-solo or Vagrant setup (although you can use the cookbook 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
- Install Ruby (1.9.3 or later) and Bundler
-
Install knife-solo and dependencies:
$ bundle install --without development:test
Building with knife-solo
- Copy ./nodes/example.json to for example ./nodes/myruby.json and edit it to match your wishes
-
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 -
Fetch the package from the server. For example:
$ scp
:/tmp/debian-7.0_ruby-1.9.3-p429-1_amd64.deb pkg/
Vagrant
Install Vagrant environment
- Install Vagrant v1.2 or later
-
Install needed Vagrant plugins:
$ vagrant plugin install vagrant-berkshelf $ vagrant plugin install vagrant-omnibus
-
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="1.9.3-p429" 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-p429" -
$ITERATION
- The package iteration version number. Passed to fpm. Defaults to 1. -
$MAINTAINER
- The (optional) package maintainer. Passed to fpm.
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.