Chef cookbook for ndenv
This cookbook installs and configures ndenv.
apt
- https://supermarket.getchef.com/cookbooks/aptbuild-essential
- https://supermarket.getchef.com/cookbooks/build-essentialgit
- https://supermarket.getchef.com/cookbooks/gitThe following platforms and versions are tested and supported using Opscode’s test-kitchen.
Ubuntu 12.04
Debian 7.2
Key | Type | Description | Default |
---|---|---|---|
[‘ndenv’][‘user’] | String | User to use for ndenv install, create if not exists. | ndenv |
[‘ndenv’][‘user_home’] | String | User home | /home/ndenv |
[‘ndenv’][‘group’] | String | Group to use for ndenv install, create if not exists. | ndenv |
[‘ndenv’][‘group_users’] | Array | List of users to add to specified group. | [] |
[‘ndenv’][‘manage_home’] | Boolean | Manage user home. Used for user resource. | true |
[‘ndenv’][‘root_path’] | String | Ndenv root path. | /opt/ndenv |
[‘ndenv’][‘profile_path’] | String | Profile.d path where will be stored ndenv init script. | /etc/profile.d |
[‘ndenv’][‘git_repository’] | String | Git repository for ndenv. | https://github.com/riywo/ndenv.git |
[‘ndenv’][‘git_reference] | String | Git reference for ndenv. | master |
[‘node_build’][‘git_repository’] | String | Git repository for node-build. | https://github.com/riywo/node-build.git |
[‘node_build’][‘git_reference] | String | Git reference for node-build. | master |
[‘ndenv’][‘installs’] | Array | List of node.js versions to install. | [‘0.10.26’] |
[‘ndenv’][‘global’] | String | Node.js version to set as global. | 0.10.26 |
This recipe install and configure ndenv for specified user/group.
Just include ndenv
in your node’s run_list
:
{
"name":"my_node",
"run_list": [
"recipe[ndenv]"
]
}
This recipe install specified node.js versions. Ndenv must be installed to use this recipe!
Set installs
and global
attributes and include ndenv::install
in your node’s run_list
:
{
"name":"my_node",
"run_list": [
"recipe[ndenv]"
"recipe[ndenv::install]"
],
"attributes": [
"ndenv": [
"installs": ["0.10.20", "0.10.26"],
"global": "0.10.26"
]
]
}
Install specified version of Node.js to be managed by ndenv.
Action | Description | Default |
---|---|---|
install | Install the version of Nodejs | Yes |
Attribute | Description | Default |
---|---|---|
node_version | the node version you wish to install | name |
force | install even if this version is already present (reinstall) | false |
global | set this node.js version as the global version | false |
Install NPM package for specified Node.js version.
Action | Description | Default |
---|---|---|
install | Install NPM package | Yes |
upgrade | Update NPM package to the latest version | No |
remove | Remove NPM package | No |
Attribute | Description | Default |
---|---|---|
package_name | the package’s name to install | name |
version | the package’s version to install | nil |
source | the package’s source to install (tarball, github..) | nil |
node_version | the node version you wish to use | nil |
response_file | not used | nil |
ndenv_node "v0.10.20"
ndenv_node "Node.js 0.10.20" do
node_version "v0.10.20"
force true
end
ndenv_npm "grunt" do
node_version "v0.10.20"
version "0.4.5"
end
ndenv_npm "grunt-cli" do
node_version "v0.10.20"
end
ndenv_npm "r.js from github" do
node_version "v0.10.20"
source "nathanfaucett/require.js"
end
ndenv_npm "forever from tarball" do
node_version "v0.10.20"
source "https://github.com/indexzero/forever/tarball/v0.5.6"
end
ndenv_npm "grunt" do
action :upgrade
node_version "v0.10.20"
end
ndenv_npm "grunt" do
action :remove
node_version "v0.10.20"
end
add_component_x
)Author | Antoine Rouyer antoine.rouyer@numergy.com |
Copyright | Copyright (c) 2014 Numergy |
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.