cookbook 'vagrant-node-simple', '~> 0.1.13'
vagrant-node-simple (9) Versions 0.1.13 Follow2
A simple cookbook to deploy your NodeJS app on Vagrant Ubuntu
cookbook 'vagrant-node-simple', '~> 0.1.13', :supermarket
knife supermarket install vagrant-node-simple
knife supermarket download vagrant-node-simple
Simple Chef Cookbook for NodeJS on Ubuntu 14.04 for Vagrant [complementary to OpsWorks NodeJS cookbook]
This recipe enables to deploy of a NodeJS app in your Vagrant box. It is complementary to Opsworks NodeJS cookebook for Opsworks deployment :
recipes vagrant-node-simple::deploy
,vagrant-node-simple::install
,vagrant-node-simple:start
are equivalent to opsworks_nodejs:default
, deploy:nodejs
, and parametrization of an Opsworks app is the same as the parametrization of the environment's JSON.
As for OpsWorks, this cookbook require a server.js
file at the root of your YOUR_NODE_APP_REPO, with listening on port 80.
Link
Usage :
Create your Chef repository with a Berksfile
, a Vagrantfile
and environments
and roles
directories :
- In the Berksfile
cookbook 'ark'
cookbook 'git'
cookbook 'apt', git: 'git://github.com/opscode-cookbooks/apt.git'
cookbook 'swap-simple', git: 'git://github.com/christopher5106/swap-simple.git'
cookbook 'vagrant-node-simple', git: 'git://github.com/christopher5106/vagrant-node-simple.git'
- In environments/development.rb :
{ "name": "development", "description": "The master development branch", "cookbook_versions": {}, "json_class": "Chef::Environment", "chef_type": "environment", "default_attributes": {}, "override_attributes": { "environment":"development", "nodejs":{ "name":"YOUR_APP_NAME", "repo":"git@bitbucket.org:YOUR_ORG/YOUR_NODE_APP_REPO.git", "revision":"HEAD" } } }
- In roles/nodejs_role.rb :
name "my node app" description "The base role" run_list "recipe[git]","recipe[apt]","recipe[ark]","recipe[swap-simple]","recipe[vagrant-node-simple::deploy]","recipe[vagrant-node-simple::install]","recipe[vagrant-node-simple:start]"
- In the Vagrantfile
VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" config.vm.network "forwarded_port", guest: 80, host: 3000 config.berkshelf.enabled = true; config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "./" chef.roles_path = "roles" chef.environments_path = "environments" chef.environment = "development" chef.add_role("nodejs_role") end end
Add your node app repository deploy key
deploy.pem
.Commit your Chef repository.
You can Launch your instance with vagrant up
command.
In Opsworks,
create a stack with your Chef repository, Chef and Berkshelf enabled (no need for a custom JSON, everything will be in the app settings.)
create a NodeJS layer (you can also create a custom layer and add the recipe "opsworks_nodejs" to the setup step, the recipe "opsworks_nodejs::configure" to the configure step, and the recipe to "deploy::nodejs" to the deploy step).
create an app with the link to your YOUR_NODE_APP_REPO.
Launch your instance in Opsworks. Opsworks will deploy the code corresponding to the Branch/Revision specified in the app configuration, to the HEAD if not specified.
You can configure a hook in Github so that committed code will be automatically deployed in Opsworks.
Dependent cookbooks
apt >= 0.0.0 |
git >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.13 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.13 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.13 failed this metric
FC055: Ensure maintainer is set in metadata: vagrant-node-simple/metadata.rb:1
FC056: Ensure maintainer_email is set in metadata: vagrant-node-simple/metadata.rb:1
FC064: Ensure issues_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC065: Ensure source_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC066: Ensure chef_version is set in metadata: vagrant-node-simple/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: vagrant-node-simple/metadata.rb:1
FC068: Ensure license is set in metadata: vagrant-node-simple/metadata.rb:1
FC069: Ensure standardized license defined in metadata: vagrant-node-simple/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.13 passed this metric
Testing File Metric
0.1.13 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.13 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 include a tag that matches this cookbook version number
0.1.13 failed this metric
0.1.13 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.13 failed this metric
FC055: Ensure maintainer is set in metadata: vagrant-node-simple/metadata.rb:1
FC056: Ensure maintainer_email is set in metadata: vagrant-node-simple/metadata.rb:1
FC064: Ensure issues_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC065: Ensure source_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC066: Ensure chef_version is set in metadata: vagrant-node-simple/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: vagrant-node-simple/metadata.rb:1
FC068: Ensure license is set in metadata: vagrant-node-simple/metadata.rb:1
FC069: Ensure standardized license defined in metadata: vagrant-node-simple/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.1.13 passed this metric
Testing File Metric
0.1.13 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.13 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 include a tag that matches this cookbook version number
0.1.13 failed this metric
FC056: Ensure maintainer_email is set in metadata: vagrant-node-simple/metadata.rb:1
FC064: Ensure issues_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC065: Ensure source_url is set in metadata: vagrant-node-simple/metadata.rb:1
FC066: Ensure chef_version is set in metadata: vagrant-node-simple/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: vagrant-node-simple/metadata.rb:1
FC068: Ensure license is set in metadata: vagrant-node-simple/metadata.rb:1
FC069: Ensure standardized license defined in metadata: vagrant-node-simple/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.1.13 passed this metric
Testing File Metric
0.1.13 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.13 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 include a tag that matches this cookbook version number
0.1.13 failed this metric
0.1.13 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 include a tag that matches this cookbook version number