How to clone from a github repo and then run npm install on puppet
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'
}
Related videos on Youtube
Comments
-
Fergie about 2 years
I have worked out how to fire up a vagrant box and
apt-get install
packagesI now want to
git clone
a node.js repo from github before runningnpm install
and running the app withnode 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 withnpm install
?