Configuring Jenkins with Bitbucket

不问归期 提交于 2019-12-06 03:17:21

You need to generate the key file to upload to your BitBucket account. From the user that is running Jenkins, do the following:

ssh-keygen -t rsa

Take the default for the key file location and leave the passphrase blank. You'll then have the ~/.ssh/id_rsa.pub file to upload to BitBucket.

I was reading this post because I had the same problem and I have found something useful right now.

MY CONFIGURATION I have a slave building server (Win7-64 machine) where I have installed the standard Git (during installation I chose the third option: "Run Git and included Unix tools from the Window command prompt".) Jenkins is configured with Java Web Start.

I have noticed that if I execute from Git shell the command

ssh -vT git@bitbucket.org

I can authenticate with the server getting the message

You can use git or hg to connect to Bitbucket. Shell access is disabled.

BUT if i execute the same command from cmd, I get

Permission denied (publickey)

I'm not sure, but I think that Git plugin execute commands from the window shell and not with git shell (as I expected), so this could determine an authentication problem in the build.

In Git Plugin docs there is a little section called "Some windows fun" that suggest to copy the .ssh user's folder under Git folder (in my case C:\Program Files (x86)\Git).

After doing so, from windows shell I ran ssh -vT git@bitbucket.org and it worked (if it doesn't work, try to restart the shell or the entire machine). Then I ran the build from Jenkins and finally it worked.

I hope this could help.

Good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!