项目作者: Numergy

项目描述 :
Chef cookbook for ndenv
高级语言: Ruby
项目地址: git://github.com/Numergy/ndenv-cookbook.git
创建时间: 2014-09-03T14:35:19Z
项目社区:https://github.com/Numergy/ndenv-cookbook

开源协议:Apache License 2.0

下载


ndenv Cookbook Build Status Cookbook Version

This cookbook installs and configures ndenv.

Requirements

cookbooks

platforms

The following platforms and versions are tested and supported using Opscode’s test-kitchen.

  • Ubuntu 12.04
  • Debian 7.2

Attributes

ndenv::default










































































KeyTypeDescriptionDefault
[‘ndenv’][‘user’]StringUser to use for ndenv install, create if not exists.ndenv
[‘ndenv’][‘user_home’]StringUser home/home/ndenv
[‘ndenv’][‘group’]StringGroup to use for ndenv install, create if not exists.ndenv
[‘ndenv’][‘group_users’]ArrayList of users to add to specified group.[]
[‘ndenv’][‘manage_home’]BooleanManage user home. Used for user resource.true
[‘ndenv’][‘root_path’]StringNdenv root path./opt/ndenv
[‘ndenv’][‘profile_path’]StringProfile.d path where will be stored ndenv init script./etc/profile.d
[‘ndenv’][‘git_repository’]StringGit repository for ndenv.https://github.com/riywo/ndenv.git
[‘ndenv’][‘git_reference]StringGit reference for ndenv.master
[‘node_build’][‘git_repository’]StringGit repository for node-build.https://github.com/riywo/node-build.git
[‘node_build’][‘git_reference]StringGit reference for node-build.master

ndenv::install














[‘ndenv’][‘installs’]ArrayList of node.js versions to install.[‘0.10.26’]
[‘ndenv’][‘global’]StringNode.js version to set as global.0.10.26

Usage

ndenv::default

This recipe install and configure ndenv for specified user/group.
Just include ndenv in your node’s run_list:

  1. {
  2. "name":"my_node",
  3. "run_list": [
  4. "recipe[ndenv]"
  5. ]
  6. }

ndenv::install

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:

  1. {
  2. "name":"my_node",
  3. "run_list": [
  4. "recipe[ndenv]"
  5. "recipe[ndenv::install]"
  6. ],
  7. "attributes": [
  8. "ndenv": [
  9. "installs": ["0.10.20", "0.10.26"],
  10. "global": "0.10.26"
  11. ]
  12. ]
  13. }

Resources/Providers

ndenv_node

Install specified version of Node.js to be managed by ndenv.

Actions
Action Description Default
install Install the version of Nodejs Yes
Attributes
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

ndenv_npm

Install NPM package for specified Node.js version.

Actions
Action Description Default
install Install NPM package Yes
upgrade Update NPM package to the latest version No
remove Remove NPM package No
Attributes
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

Examples

Installing Node.js 0.10.20
  1. ndenv_node "v0.10.20"
Forcefully install Node.js 0.10.20
  1. ndenv_node "Node.js 0.10.20" do
  2. node_version "v0.10.20"
  3. force true
  4. end
Install grunt package version 0.4.5 for Node.js v0.10.20
  1. ndenv_npm "grunt" do
  2. node_version "v0.10.20"
  3. version "0.4.5"
  4. end
Install latest grunt-cli package for Node.js v0.10.20
  1. ndenv_npm "grunt-cli" do
  2. node_version "v0.10.20"
  3. end
Install require.js package from github
  1. ndenv_npm "r.js from github" do
  2. node_version "v0.10.20"
  3. source "nathanfaucett/require.js"
  4. end
Install forever package from tarball
  1. ndenv_npm "forever from tarball" do
  2. node_version "v0.10.20"
  3. source "https://github.com/indexzero/forever/tarball/v0.5.6"
  4. end
Update grunt package to the latest version
  1. ndenv_npm "grunt" do
  2. action :upgrade
  3. node_version "v0.10.20"
  4. end
Remove grunt package
  1. ndenv_npm "grunt" do
  2. action :remove
  3. node_version "v0.10.20"
  4. end

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

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

  1. 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.