Hi. We have written a maven plug-in so that whenever a feature branch is merged in develop branch it tags the commit automatically based on some information. We are using JGit to do that. For now, for testing, I am using my own username and password and since we only use our credentials to push the changes from local machine, I assumed that in Pipeline it works the same way but it appears Pipeline is using ssh. See this post please: https://stackoverflow.com/posts/comments/87140837?noredirect=1
How can we configure jgit to be able to push the changes automatically? By that I mean the details of ssh connection.
Thanks
Hi,
are you looking for automatically ssh connection if that is the question i will suggest to create one account which is use for building which will be locally on that machine.
Thanks
DJM
I am just trying to run a git command (git push).
My username is a valid and I even created ssh key. So in my project settings I generated a ssh key under Pipeline section and then added the key to my username, see this link:
https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-ssh1
But when I use this path to point to the private key: "~/.ssh/id_rsa" I get file not found error. And when I change it to "~/.ssh/config" as it mentions in the SSH Key section under Pipeline, I get invalid privatekey error.
What have I missed here?
How can I use Https to push my changes rather than ssh?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
are you able to push using command line using ssh and using https
if yes then if you are doing build using this account it should then allow you to do this
Please try using command line first and see what error you are getting while push using https and using ssh
Thanks
DJM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I put "cat" command to see the content of "~/.ssh/config" and realised that the private key path is actually inside this file not the privatekey itself. And that was:
/opt/atlassian/pipelines/agent/data/id_rsa
That's why JGit was returning with "invalid private key" error. Once I set that, it worked.
Thanks for your time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.