ndenv Cookbook
Description
Manages nbenv and its installed node.js.
Requirements
build-essential
Installation
Depending on the situation and use case there are several ways to install this cookbook. All the methods listed below assume a tagged version release is the target, but omit the tags to get the head of development. A valid Chef repository structure like the opscode/chef-repo repo is also assumed.
Using Berkshelf
Berkshelf is a cookbook dependency manager and development workflow assistant.
To install Berkshelf:
gem install berkshelf
berkshelf init .
Berkshelfile:
source "https://api.berkshelf.com"
cookbook 'ndenv', git: 'git://github.com/mostlyfine/chef-ndenv.git'
Attributes
ndenv::default
Key | Type | Description | Default |
---|---|---|---|
['ndenv']['user'] | String | author user name | root |
['ndenv']['group'] | String | author group name | ndenv |
['ndenv']['members'] | Array | group members | ['root'] |
['ndenv']['ndenv_root'] | String | ndenv install directory | /usr/local/ndenv |
['ndenv']['profile_path'] | String | add `ndenv` init to your shell to enable shims. | /etc/profile.d |
['ndenv']['build'] | Array | node.js versions to builded. | ['v0.10.20'] |
['ndenv']['global'] | String | set global this node.js version. | 'v0.10.20' |
Usage
ndenv::default
Create user, group and checkout for repository.
Just include ndenv
in your node's run_list
:
{
"run_list": [
"recipe[ndenv]"
]
}
ndenv::install
Build node.js and set default version.
{
"run_list": [
"recipe[ndenv::install]"
]
}
{
"ndenv": {
"user": "taro",
"ndenv_root": "/home/taro/.ndenv",
"profile_path": "/home/taro/.ndenv"
},
"run_list": [
"recipe[ndenv::default]"
"recipe[ndenv::install]"
]
}
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 and Authors
MIT, Authors: mostlyfine