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

查看:18
本文介绍了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 子树 的.在撰写本文时,它们不在官方 git 源中,因此需要手动安装,但它们将包含在 v1.7.11 中.目前它可以在 homebrew 和 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}

这会增加 repo 的大小,但通过使用 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天全站免登陆