私人凉亭:git 缓存?
private-bower : git cache?
我有一个使用 https://github.com/Hacklone/private-bower 的私人 Bower 安装。
它在没有任何缓存的情况下运行良好,但我想缓存 public Git 存储库。我使用了以下配置:
"repositoryCache": {
"cachePrivate": false,
"git": {
"enabled": false,
"cacheDirectory": "./gitRepoCache",
"host": "localhost",
"port": 6789,
"publicAccessURL" : null,
"refreshTimeout": 10
}
}
我确实在 ./gitRepoCache 文件夹中看到 public git 项目,但是在安装我的 Bower 项目时,Bower 会尝试
resolve git://localhost:6790/qunit#~1.16.0
根据我们的配置,我可以理解它为什么这样做,但我完全不知道我应该做什么才能让 url "gitaccessible" 指向该文件夹?任何帮助将不胜感激。
事实证明 private-bower 正在启动它自己的 git-daemon,所以唯一遗漏的是 publicAccessURL 属性,它在 bower 安装时返回 运行.将 publicAccessURL 设置为机器的 IP 运行ning private-bower 成功了。
我遇到过类似的问题,我认为值得推荐private-bower
、https://github.com/tandrup/docker-private-bower
的docker
我自己刚刚使用了配置文件,更改参数以匹配我的 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
时,所有的库仍然是从 repos 下载的。
要修复它,您必须调用
bower cache clean
并再次安装依赖项。然后,它们也会缓存在您的服务器上。
我有一个使用 https://github.com/Hacklone/private-bower 的私人 Bower 安装。
它在没有任何缓存的情况下运行良好,但我想缓存 public Git 存储库。我使用了以下配置:
"repositoryCache": {
"cachePrivate": false,
"git": {
"enabled": false,
"cacheDirectory": "./gitRepoCache",
"host": "localhost",
"port": 6789,
"publicAccessURL" : null,
"refreshTimeout": 10
}
}
我确实在 ./gitRepoCache 文件夹中看到 public git 项目,但是在安装我的 Bower 项目时,Bower 会尝试
resolve git://localhost:6790/qunit#~1.16.0
根据我们的配置,我可以理解它为什么这样做,但我完全不知道我应该做什么才能让 url "gitaccessible" 指向该文件夹?任何帮助将不胜感激。
事实证明 private-bower 正在启动它自己的 git-daemon,所以唯一遗漏的是 publicAccessURL 属性,它在 bower 安装时返回 运行.将 publicAccessURL 设置为机器的 IP 运行ning private-bower 成功了。
我遇到过类似的问题,我认为值得推荐private-bower
、https://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
时,所有的库仍然是从 repos 下载的。
要修复它,您必须调用
bower cache clean
并再次安装依赖项。然后,它们也会缓存在您的服务器上。