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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 08:56:03  来源:igfitidea点击:

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

gitnode.jsnpmvagrantpuppet

提问by Fergie

I have worked out how to fire up a vagrant box and apt-get installpackages

我已经研究出如何启动一个流浪盒子和apt-get install包裹

I now want to git clonea node.js repo from github before running npm installand 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 clonea 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'
}