Heroku上的NPM私人git模块 [英] NPM private git module on Heroku

查看:99
本文介绍了Heroku上的NPM私人git模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将我的应用程序部署到Heroku,但是我依靠一些私有git回购作为模块。我这样做是为了在项目之间重用代码,例如我有一个自定义记录器,我在多个应用程序中使用。

I am trying to deploy my app to Heroku however I rely on using some private git repos as modules. I do this for code reuse between projects, e.g. I have a custom logger I use in multiple apps.

"logger":"git+ssh://git@bitbucket.org..............#master"

问题是Heroku显然没有ssh访问这段代码。我在这个问题上找不到任何东西。理想情况下,Heroku有一个公钥,我可以将它添加到模块中。

The problem is Heroku obviously does not have ssh access to this code. I can't find anything on this problem. Ideally Heroku have a public key I can can just add to the modules.

推荐答案

简而言之,这是不可能的。我想出的这个问题的最佳解决方案是使用新的 git subtree 的。在撰写本文时,他们不在官方的git源代码中,因此需要手动安装,但它们将包含在v1.7.11中。目前它可用于自制软件和apt-get。然后是一个做的事情

In short it is not possible. The best solution to this problem I came up with is to use the new git subtree's. At the time of writing they are not in the official git source and so needs to be installed manual but they will be included in v1.7.11. At the moment it is available on homebrew and apt-get. it is then a case of doing

git subtree add -P /node_modules/someprivatemodue git@github.......someprivatemodule {master|tag|commit}

这会扩大回购大小,但通过更新很容易上面的命令用gitsubtree pull。

this bulks out the repo size but an update is easy by doing the command above with gitsubtree pull.

这篇关于Heroku上的NPM私人git模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆