我正在尝试通过composer install
在私有bitbucket存储库中安装composer依赖项,并在我的IIS服务器上使用composer.json中的行(由Jenkins CI触发)。
"repositories": [
{
"type": "vcs",
"url": "ssh://git@bitbucket.org/company/repo-name.git"
}
],
结果是:
Failed to execute git clone --mirror "ssh://git@bitbucket.org/company/web.git" "C:/Users/myusername/AppData/Local/Composer/vcs/ssh---company-bitbucket.org-repo-name.git/"
Cloning into bare repository 'C:/Users/myusername/AppData/Local/Composer/vcs/ssh---company-bitbucket.org-repo-name.git'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
是否可以在不需要ssh-agent的情况下将private.ppk与composer链接?
答案 0 :(得分:0)
Jenkins CI以sysuser身份登录,因此导航到其.ssh文件夹并编辑配置文件:C:\ Windows \ System32 \ config \ systemprofile.ssh \ config(如果“config”文件不存在,请创建它)< / p>
将您的密钥存储到例如keys子文件夹:C:\ Windows \ System32 \ config \ systemprofile.ssh \ keys \ bitbucket
在配置文件中添加以下行:
Host bitbucket.org
HostName bitbucket.org
User git
IdentityFile ~/.ssh/keys/bitbucket