I have worked out how to fire up a vagrant box and apt-get install
packages
I now want to git clone
a node.js repo from github before running npm install
and running the app with node app.js
I expected to be able to achieve this by issuing BASH commands, but I see now that puppet requires this to be done in a puppety way. The results from Google on this issue are confusing and inconsistent.
So- how do you tell Puppet to git clone
a node.js package from github and then install it with npm install
?
In terminal at the root of the project run npm install to install necessary dependencies. Then check if npm start is set up properly inside the 'Scripts' object in your package. json Finally run npm start This should do it for you, but most attention should paid to instructions inside README.md provided by developer.
You can use the puppet-nodejs module to manage npm packages. Take a look at https://forge.puppetlabs.com/puppetlabs/nodejs
Otherwise, this article should explain how to clone a git repo. http://livecipher.blogspot.com.au/2013/01/deploy-code-from-git-using-puppet.html
More info can be found at https://github.com/puppetlabs/puppetlabs-vcsrepo.
Once installed you should be able to do something like:
vcsrepo { "/path/to/repo":
ensure => present,
provider => git,
source => 'git://example.com/repo.git',
revision => 'master'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With