private-bower:git cache?

时间:2015-03-27 16:16:24

标签: git caching bower

我使用https://github.com/Hacklone/private-bower安装了私人凉亭。

没有任何缓存它工作得很好,但我想缓存公共Git存储库。我使用了以下配置:

 "repositoryCache": {
    "cachePrivate": false,
    "git": {
        "enabled": false,
        "cacheDirectory": "./gitRepoCache",
        "host": "localhost",
        "port": 6789,
        "publicAccessURL" : null,
        "refreshTimeout": 10
    }
}

我确实在./gitRepoCache文件夹中看到了公共git项目,但在安装我的bower项目时,bower尝试

 resolve git://localhost:6790/qunit#~1.16.0

我可以看到为什么它会根据我们的配置做到这一点,但我完全不知道我应该做什么,以便我有一个指向该文件夹的URL“gitaccessible”?任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:1)

事实证明private-bower正在启动自己的git-daemon,所以唯一遗漏的是publicAccessURL属性,它在运行bower安装时返回。将publicAccessURL设置为机器的运行私人凉亭的IP就可以了。

答案 1 :(得分:0)

我遇到过类似问题,我认为值得推荐private-bowerhttps://github.com/tandrup/docker-private-bower

的码头工具

我自己刚刚使用配置文件,更改参数以匹配我的IP地址和路径。

...
"git": {
   "enabled": true,
   "cacheDirectory": "/data/gitRepoCache",
   "host": "0.0.0.0",
   "port": 6789,
   "publicAccessURL" : "<address>:6789",
   "refreshTimeout": 10
},
...

设置我的项目.bowerrc文件:

{"registry": "http://<address>:5678"}

这个配置就足够了。虽然在我的机器上调用bower install时,所有库仍然是从回购站下载的。

要解决此问题,您必须致电

bower cache clean

再次安装依赖项。然后,它们也将缓存在您的服务器上。