cookbook 'chruby-build', '= 0.4.0'
chruby-build (12) Versions 0.4.0 Follow3
Chef cookbook to install chruby and build rubies from source with Google Perftools and LibYAML options.
cookbook 'chruby-build', '= 0.4.0', :supermarket
knife supermarket install chruby-build
knife supermarket download chruby-build
Chruby Build Chef Cookbook
Chef cookbook to install chruby and build rubies from source with Google Perftools / TCMalloc : Thread-Caching Malloc and LibYAML options.
Requirements
supports
ubuntu >= 12.04
depends
-
apt
- Opscode Cookbook apt -
ark
- Opscode Cookbook ark
Installation
From the Community Site
Use the knife command:
$ knife cookbook site install chruby-build
With librarian-chef
Edit Cheffile
site "https://supermarket.chef.io/api/v1"
cookbook 'chruby-build', '~> 0.4.0'
Resolves and installs all of the dependencies:
$ librarian-chef install
With berkshelf
Edit Berksfile
source "https://supermarket.getchef.com"
cookbook 'chruby-build', '~> 0.4.0'
Install the cookbooks you specified in the Berksfile and their dependencies:
$ berks install
Attributes
See [attributes/default.rb](attributes/default.rb)
<table>
<tr>
<th>Description</th>
<th>Type</th>
<th>Default</th>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['version']</tt></td>
</tr>
<tr>
<td>chruby version</td>
<td>String</td>
<td><tt>"0.3.9"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['checksum']</tt></td>
</tr>
<tr>
<td>chruby checksum (SHA256)</td>
<td>String</td>
<td><tt>"7220a96e355b8a613929881c091ca85ec809153988d7d691299e0a16806b42fd"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['auto_switching']</tt></td>
</tr>
<tr>
<td>chruby auto switching</td>
<td>Boolean</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['rubies']</tt></td>
</tr>
<tr>
<td>rubies to install</td>
<td>Array</td>
<td><tt>[]</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['rubies_path']</tt></td>
</tr>
<tr>
<td>path to install rubies</td>
<td>String</td>
<td><tt>"/opt/rubies"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['rubies_libs']</tt></td>
</tr>
<tr>
<td>usefull libraries to install</td>
<td>Array</td>
<td><tt>["libssl-dev", "libreadline-dev", "zlib1g-dev"]</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['google_perftools']['enable']</tt></td>
</tr>
<tr>
<td>compile rubies with google_perftools (tcmalloc)</td>
<td>Boolean</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['google_perftools']['url']</tt></td>
</tr>
<tr>
<td>google_perftools url</td>
<td>String</td>
<td><tt>"https://github.com/gperftools/gperftools/releases/download/gperftools-2.3/gperftools-2.3.tar.gz"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['google_perftools']['version']</tt></td>
</tr>
<tr>
<td>google_perftools version</td>
<td>String</td>
<td><tt>"2.3"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['google_perftools']['checksum']</tt></td>
</tr>
<tr>
<td>google_perftools checksum</td>
<td>String</td>
<td><tt>"093452ad45d639093c144b4ec732a3417e8ee1f3744f2b0f8d45c996223385ce"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['libyaml']['enable']</tt></td>
</tr>
<tr>
<td>compile libyaml (latest release)</td>
<td>Boolean</td>
<td><tt>true</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['libyaml']['url']</tt></td>
</tr>
<tr>
<td>libyaml url</td>
<td>String</td>
<td><tt>"http://pyyaml.org/download/libyaml/yaml-0.1.7.tar.gz"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['libyaml']['version']</tt></td>
</tr>
<tr>
<td>libyaml version</td>
<td>String</td>
<td><tt>"0.1.7"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['chruby_build']['libyaml']['checksum']</tt></td>
</tr>
<tr>
<td>libyaml checksum</td>
<td>String</td>
<td><tt>"8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729"</tt></td>
</tr>
</table>
Usage
Rubies attributes
-
id
- required id and must be split by a dash (eg. ruby-2.3.4) -
url
- required ruby source -
checksum
- optional sha256 package checksum -
gems
- optional gems to install -
environment
- optional compilation environment variables
With node attributes
{ "ark": { "prefix_root": "/usr/local/src" }, "chruby_build": { "rubies": [ { "id": "ruby-2.3.4", "url": "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.gz", "checksum": "98e18f17c933318d0e32fed3aea67e304f174d03170a38fd920c4fbe49fec0c3", "gems": ["bundler"], "environment": { "ARCHFLAGS": "-arch x86_64", "CFLAGS": "-g -O2", "CPPFLAGS": "-I/usr/include -I/usr/local/include" } } ] } }
With data bags
Data bag name must be rubies
$ knife data bag create rubies ruby-2.3.4
Edit data bag ruby-2.3.4.json
{ "id": "ruby-2.3.4", "url": "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.gz", "checksum": "98e18f17c933318d0e32fed3aea67e304f174d03170a38fd920c4fbe49fec0c3", "gems": ["bundler"], "environment": { "ARCHFLAGS": "-arch x86_64", "CFLAGS": "-g -O2", "CPPFLAGS": "-I/usr/include -I/usr/local/include" } }
If you are using knife solo as provisioner, try knife-solo_data_bag.
Data bags have higher precedence.
Recipes
chruby-build::default
This recipe only installs chruby.
Just include chruby-build::default
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[chruby-build::default]" ] }
chruby-build::rubies
This recipe installs chruby and compile rubies from source.
Just include chruby-build::rubies
in your node's run_list
:
{ "name":"my_node", "run_list": [ "recipe[chruby-build::rubies]" ] }
Development
Dependencies
Installation
Ensure the gem dependencies are installed:
$ bundle install $ bundle exec berks install
Running unit tests:
$ bundle exec rspec
Running integration tests:
$ bundle exec kitchen test rubies-data-bags-ubuntu-1404
Different test suites are available:
$ bundle exec kitchen list $ bundle exec kitchen setup default-ubuntu-1404 $ bundle exec kitchen verify default-ubuntu-1404 $ bundle exec kitchen destroy default-ubuntu-1404
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License
Written by Vincent Durand.
Released under the terms of the MIT License. For further information, please see the file [LICENSE.txt](LICENSE.txt).
Dependent cookbooks
apt >= 0.0.0 |
ark >= 0.8 |
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
FC066: Ensure chef_version is set in metadata: chruby-build/metadata.rb:1
FC120: Do not set the name property directly on a resource: chruby-build/recipes/rubies.rb:98
Run with Foodcritic Version 14.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 passed this metric
0.4.0 failed this 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
FC066: Ensure chef_version is set in metadata: chruby-build/metadata.rb:1
FC120: Do not set the name property directly on a resource: chruby-build/recipes/rubies.rb:98
Run with Foodcritic Version 14.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 passed this metric
0.4.0 failed this metric
FC120: Do not set the name property directly on a resource: chruby-build/recipes/rubies.rb:98
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
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 passed this metric
0.4.0 failed this metric
0.4.0 passed this metric