简体   繁体   English

如何从github repo克隆然后在puppet上运行npm install

[英]How to clone from a github repo and then run npm install on puppet

I have worked out how to fire up a vagrant box and apt-get install packages 我已经研究了如何启动一个流浪盒和apt-get install

I now want to git clone a node.js repo from github before running npm install and running the app with node app.js 我现在想要在运行npm install并使用node app.js运行应用程序之前从github git clone一个node.js repo

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. 我希望能够通过发布BASH命令来实现这一目标,但我现在看到傀儡要求以傀儡的方式完成。 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 ? 那你怎么告诉Puppet从github git clone一个node.js包然后用npm install呢?

You can use the puppet-nodejs module to manage npm packages. 您可以使用puppet-nodejs模块来管理npm包。 Take a look at https://forge.puppetlabs.com/puppetlabs/nodejs 看看https://forge.puppetlabs.com/puppetlabs/nodejs

Otherwise, this article should explain how to clone a git repo. 否则,本文应该解释如何克隆git repo。 http://livecipher.blogspot.com.au/2013/01/deploy-code-from-git-using-puppet.html 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 . 更多信息可以在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'
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM