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

nvm (6) Versions 0.1.7

Installs nvm, the node version manager

Policyfile
Berkshelf
Knife
cookbook 'nvm', '~> 0.1.7', :supermarket
cookbook 'nvm', '~> 0.1.7'
knife supermarket install nvm
knife supermarket download nvm
README
Dependencies
Quality 50%

nvm

Chef cookbook for setting up NVM from creationix's github repository.

Requirements

Built to run on Linux distributions. Tested on Ubuntu 12.04.
Depends on the git cookbook.

Usage

Install nvm and node.js version 0.10.5.

# install nvm
include_recipe 'nvm'

# install node.js v0.10.5
nvm_install 'v0.10.5'  do
  from_source false
  alias_as_default true
  action :create
end

For more usage examples, have a look to the recipes in test/cookbooks/nvm_test/recipes/.

Attributes

  • node['nvm']['directory'] - directory where nvm is cloned, default '/usr/local/src/nvm'
  • node['nvm']['repository'] - url of the git repository, default 'git://github.com/creationix/nvm.git'
  • node['nvm']['reference'] - reference in the repository, default 'master'
  • node['nvm']['source'] - command to source nvm script file, default 'source /etc/profile.d/nvm.sh'
  • node['nvm']['install_deps_to_build_from_source'] - if true install the dependencies to compile node, otherwise not, default true

LWRPs

nvm_install

Install a node.js version from source or binaries

Actions

  • create (default)

Attributes

  • version - node.js version, default to the name attribute
  • from_source - install from source if true, default to false
  • alias_as_default - alias the current version as the default version, default true
Only used for user install
  • user_install - install nvm for a particular user, default false
  • user - user to install nvm as, no default
  • group - group to install nvm as, defaults to user
  • user_nome - home directory of user for user install if it is a non standard home directory, default /home/$user
  • nvm_directory -

Examples

Install from binary

nvm_install '0.10.5'  do
  from_source false
  alias_as_default true
  action :create
end

Install from source

nvm_install '0.10.5'  do
  from_source true
  alias_as_default true
  action :create
end

Install as user

nvm_install '0.10.5' do
  user 'myuser'
  group 'mygroup'
  from_source false
  alias_as_default true
  action :create
end

Multiple user installs

nvm_install 'nvm for userone' do
  version '0.10.5'
  user 'userone'
  group 'userone'
  from_source false
  alias_as_default true
  action :create
end
nvm_install 'nvm for usertwo' do
  version '0.10.5'
  user 'usertwo'
  group 'usertwo'
  from_source false
  alias_as_default true
  action :create
end

Nonstandard user home user install

nvm_install '0.10.5' do
  user 'usertwo'
  group 'usertwo'
  user_home '/opt/usertwo'
  from_source false
  alias_as_default true
  action :create
end

nvm_alias_default

Use by default the given node.js version

Actions

  • create (default)

Attributes

  • version - node.js version, default to the name attribute

Example

Use by default node.js version 0.10.0

nvm_alias_default '0.10.0'  do
  action :create
end

Cookbook development

You will need to do a couple of things to be up to speed to hack on this cookbook.
Everything is explained here have a look.

Test

bundle exec rake cookbook:full_test

Licence

Author: Rémy Loubradou

Copyright 2013 HipSnip Limited

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.

Collaborator Number Metric
            

0.1.7 passed this metric

Contributing File Metric
            

0.1.7 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.1.7 failed this metric

FC021: Resource condition in provider may not behave as expected: nvm/providers/install.rb:94
FC034: Unused template variables: nvm/templates/default/nvm.sh.erb:1
FC064: Ensure issues_url is set in metadata: nvm/metadata.rb:1
FC065: Ensure source_url is set in metadata: nvm/metadata.rb:1
FC066: Ensure chef_version is set in metadata: nvm/metadata.rb:1
FC069: Ensure standardized license defined in metadata: nvm/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: nvm/providers/alias_default.rb:49
FC085: Resource using new_resource.updated_by_last_action to converge resource: nvm/providers/install.rb:102
FC121: Cookbook depends on cookbook made obsolete by Chef 14: nvm/metadata.rb:1
FC122: Use the build_essential resource instead of the recipe: nvm/recipes/default.rb:47
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.1.7 passed this metric

Testing File Metric
            

0.1.7 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.1.7 passed this metric