我正在部署一个PHP / Symfony网站。该存储库和大多数第三方库都存储在Github中。但是,对于一个私有库,我们必须使用Bitbucket存储库。在使用存储在单独的auth.json
文件中的标准登录/通过身份验证之前,
{
"http-basic": {
"bitbucket.org/private_repo": {
"username": "login","password": "password"
}
}
}
到目前为止有效。但是现在我们有了这些警告:
- Installing private_repo (v1.5.0): Cloning ...
16:19:07 Invalid OAuth consumer provided.
16:19:07 This can have two reasons:
16:19:07 1. You are authenticating with a bitbucket username/password combination
16:19:07 2. You are using an OAuth consumer,but didn't configure a (dummy) callback url
这似乎很正常,因为我们处于第二种情况。因此,我们尝试使用OAuth令牌:
{
"bitbucket-oauth": {
"bitbucket.org": {
"consumer-key": "consumer-key","consumer-secret": "consumer-secret"
}
}
}
它似乎在本地工作。但是在生产服务器上,似乎仍在使用旧凭据,并且我们有相同的警告消息(检出有效)。
但是在一台服务器上根本不起作用:
[RuntimeException]
Failed to execute git clone --no-checkout 'git@bitbucket.org:private_org/private_repo.git' '/data/apps/app/front/6.4.1/vendor/private_org/common'
&& cd '/data/apps/app/front/6.4.1/vendor/private_org/common' && git remote add composer 'git@bitbucket.org:private_org/private_repo.git'
&& git fetch composer && git remote set-url origin 'git@bitbucket.org:private_org/private_repo.git'
&& git remote set-url composer 'git@bitbucket.org:private_org/private_repo.git'
Cloning into '/data/apps/app/front/6.4.1/vendor/private_org/common'...
Could not create directory '/var/www/.ssh'.
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
很难调试,因为似乎存在Bitbucket凭据的缓存。在工作站上,我删除了auth.json
文件,如果再次运行php composer.phar install
,则完全没有错误。每个库,甚至是私有库都已正确安装。
我怎么知道调用git clone命令时使用的真实凭据是什么?如何正确调试?谢谢。