Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Jenkins,bitbucket,mercurial和SSH_Php_Mercurial_Ssh_Jenkins_Bitbucket - Fatal编程技术网

Php Jenkins,bitbucket,mercurial和SSH

Php Jenkins,bitbucket,mercurial和SSH,php,mercurial,ssh,jenkins,bitbucket,Php,Mercurial,Ssh,Jenkins,Bitbucket,我已经设置了jenkins,以便它从bitbucket repo中提取代码,但要做到这一点,我必须开始使用SSH而不是HTTPS,因此我重新配置了mercurial 但是,我现在无法推送文件,因为我遇到以下错误:“存储库访问被拒绝,通过部署密钥的访问是只读的” 我要做的是在bitbucket上的deployment key部分设置公钥,并在pageant中启动私钥 有人知道我怎样才能摆脱这个错误吗 谢谢你的帮助 顺便说一句,这是我的mercurial.ini: [ui] username = u

我已经设置了jenkins,以便它从bitbucket repo中提取代码,但要做到这一点,我必须开始使用SSH而不是HTTPS,因此我重新配置了mercurial

但是,我现在无法推送文件,因为我遇到以下错误:“存储库访问被拒绝,通过部署密钥的访问是只读的”

我要做的是在bitbucket上的deployment key部分设置公钥,并在pageant中启动私钥

有人知道我怎样才能摆脱这个错误吗

谢谢你的帮助

顺便说一句,这是我的mercurial.ini:

[ui]
username = username <email>
ssh = "TortoisePlink.exe" -ssh -2 -batch -C

[auth]
bitbucket.username = username
bitbucket.password = password

[extensions]
largefiles =

[paths]
default = ssh://hg@bitbucket.org/username/project
[ui]
用户名=用户名
ssh=“TortoisePlink.exe”-ssh-2-batch-C
[授权]
bitbucket.username=用户名
bitbucket.password=密码
[延期]
大文件=
[路径]
默认值=ssh://hg@bitbucket.org/username/project

我已经花了几天的时间来设置所有内容,因此任何答案都将不胜感激:D谢谢。

当您通过ssh推送到bitbucket时,您需要使用您的ssh密钥,而不是您设置的部署密钥。您可以自己在bitbucket设置中添加一个。通常,您会让Jenkins以自己的windows用户身份运行,并使用自己的pagent,该用户将使用只读部署密钥。您将作为自己的windows用户进行推送,并使用自己的ssh密钥

也就是说,如果您想快速完成,您可以将
[path]
部分更改为:

[paths]
default = ssh://hg@bitbucket.org/username/project
default-push = http://bitbucket.org/username/project
然后当jenkins拉取时,它将使用
默认路径,即ssh和您配置的部署密钥。推送时,您将使用
默认推送路径,即http,并将检查
[auth]
部分(或提示您输入密码)