gin93r
gin93r

Reputation: 1593

Authentication failing when Bamboo tries to checkout Submodule

Has anyone been able to get their Bamboo plans to checkout the submodules?

It seems to be failing the authentication. I have read that I need to set up SSH authentication, which I tried (though there could have been errors on my part), but it prevented my plan from even running.

I created a set of ssh keys and added the key to the Bamboo > Shared Credentials. I also added the key to the Stash repo figuring that it would then allow Bamboo to pull via ssh, no dice.

So if anyone has been able to set this up, I would really appreciate some step by step guidance.

Upvotes: 2

Views: 3560

Answers (3)

ehambright
ehambright

Reputation: 1593

This question is a bit old, but is what came up when I was running into issues with Submodules using Bitbucket and was googling. Here is how I solved it. Using another git host, this may not help.

First, make sure you are on Bamboo 8.1.1 or later as they added support for using the SSH key configured for your linked repository to authenticate to submodules.

This option is under "Linked repositories"->->Advanced options and is labeled "SSH key applies to submodules".

Secondly, follow the directions here to make sure your submodules use the correct path descriptions so Bamboo can understand them; Bitbucket server and cloud repositories with Git Submodules

Finally, add the "Public key generated for this repository" from the advanced options of your repository to the repository your submodule is hosted in. You do that in Bitbucket using Repository Settings->Access Keys->Add key and copy and paste from the advanced options in the Linked Repository public key setting.

Upvotes: 1

VRK
VRK

Reputation: 1366

This is what I did in my environment.

  1. Generated SSH private key and checked it in subversion.
  2. Placed the checked out copy of the key in the agent where bamboo home is present.
  3. In my case it is c:\ so I copied it to c:\var\keys\ssh\id_rsa\
  4. In the bamboo plans, change the repository url: Replace https://svn.abc.com/development/project1 with svn+ssh://subversion.abc.com/svn/development/project1
  5. Authentication TYPE: SSH
  6. Private Key: /var/keys/ssh/id_rsa/key1

Upvotes: 0

Westy92
Westy92

Reputation: 21345

I did a number of things to get this working, but I'm not sure if they were all required.

  1. Generate SSH keys and add to ~/.ssh (and ~/bamboo-home/.ssh)
  2. Create ~/.ssh/config (and ~/bamboo-home/.ssh) with IdentityFile ~/.ssh/<key-name>
  3. Add this key to the ssh-agent. https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#adding-your-ssh-key-to-the-ssh-agent
  4. Clone a repository on the server using this key and allow the fingerprint
  5. Add a custom script to my plan that calls git submodule update --init --recursive
  6. Use a linked repository and enable "Use submodules"

Upvotes: 1

Related Questions