git 如何从 github 存储库克隆,然后在 puppet 上运行 npm install
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18329821/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to clone from a github repo and then run npm install on puppet
提问by Fergie
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
我现在想git clone
在运行npm install
和运行应用程序之前从 github 获取 node.js 存储库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.
我希望能够通过发出 BASH 命令来实现这一点,但我现在看到 puppet 要求以 puppety 的方式完成此操作。谷歌在这个问题上的结果令人困惑和不一致。
So- how do you tell Puppet to git clone
a node.js package from github and then install it with npm install
?
那么 - 你如何告诉 Puppetgit clone
来自 github 的 node.js 包,然后用 安装它npm install
?
回答by Andrew Dwyer
You can use the puppet-nodejs module to manage npm packages. Take a look at https://forge.puppetlabs.com/puppetlabs/nodejs
您可以使用 puppet-nodejs 模块来管理 npm 包。看看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
否则,本文应该解释如何克隆 git 存储库。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'
}