I’ve already set jenkins up so that it pulls the code from bitbucket repo, but to do that I had to start using SSH instead of HTTPS, so I reconfigured mercurial to do so.
However, I can’t push files now, because I’m getting the following error: “Repository access denied, access via deployment key is read-only”.
What I do is setting in the deployment key section on bitbucket the public key, and starting the private key in the pageant.
Does anyone knows how can I get rid of this error?
Thanks for help.
BTW. This is my 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
I have spent a couple of days on setting everything up already, so any answer will be appreciated 😀 Thanks.
When you push to bitbucket over ssh you need to do so using your ssh key, not the deploy key that you set up. You can add one yourself in your bitbucket settings. Normally you’d have Jenkins running as its own windows user with its own pagent, and that user would use the read-only deploy key. You’d be doing your pushes as your own windows user and you’d be using your own ssh key.
That said if you want to do it hastily you can probably get by with changing your
[paths]section to this:Then when jenkins pulls it’ll be using the
defaultpath, which is ssh and the deploy key you’ve configured. When you push you’ll be using thedefault-pushpath, which is http, and will check your[auth]section (or prompt you for your password).