Using git submodules through ssh with Bamboo

best practice November 27, 2012

I have a git repository with submodules that are linked with different external git-servers. How can I pass ssh authentification for each submodule and user? Can I put separate options for each submodule in Bamboo?

Can I checkout every submodule on the neccessary branch automatically? And can I view not only root changelog, but every submodule's changelog in one time?

3 answers

1 vote
PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 27, 2012

Hello,

AFAIK the only method of passing ssh authentication currently is to set up the authentication on Bamboo server and on every Bamboo agent manually (via .ssh/config). I guess that way you can configure different options for different submodules. But that's not configurable from the Bamboo.

"Can I checkout every submodule on the neccessary branch automatically?"

What do you mean exactly? My first answer would be 'yes, you can', but I've might misunderstood your use case. Care to elaborate a bit more?

"And can I view not only root changelog, but every submodule's changelog in one time?"

No, you can't see that in Bamboo yet. Can I ask you however, how important would be that feature to you? Is it a must-have feature, or rather minor one?

cheers,

best practice November 27, 2012

Thnaks for your answer!

the situation is that now we are working on Jenkins with git plugin. Git plugin allows to get all repository with all brunches. and we have to switch on the neccessary brunch manually (or using scripts). We need to find the way to do it automatically. One of the suggested ways is to edit git-plugin sources. But the easiest way is to find a ready solution.

Rafael Bodill January 9, 2013

Unfortunately Bamboo won't use the same private SSH key set as the plan's repository key, with the underlying submodules within the source code. So the only possible solution is via `.ssh/config`. Is this something that will be fixed, Atlassian ?

Mark Snelling January 16, 2013

I'd also like to know the answer to this. I'm currently struggling with Git submodules on Bamboo OnDemand, there doesn't seem to be a clear solution or documentation on how to do this.

Rafael Bodill January 16, 2013

@Mark I ended up adding the IdentityFile parameters in /home/bamboo/.ssh/config along with the key itself. I'm pretty sure you can't do that with the OnDemand, as you don't have ssh access..

Wish Atlassian published a Bamboo/Git "known issues" sheet. There's many.

Mark Snelling January 16, 2013

Thanks @rafi, I'm using a custom Windows AMI so I may be able to put an SSH key in there somewhere.

Rafael Bodill January 16, 2013

@Mark Either name the private key "id_rsa" and place it in /home/bamboo/.ssh/
Or if you want it named differently, create a /home/bamboo/.ssh/config which will look like:

IdentityFile ~/.ssh/github_key

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2013

@rafi - where you would like to see such "Bamboo/Git known issues" sheet? And which particular issues you have on mind? I'm asking because in a spare time I could try to write up some kind of summary/sheet and publish it somewhere, but I am not sure how to start it. Care to help?

Andrew Arminio January 21, 2013

Where should I put my .ssh folder for this to work. Say I have bamboo running under my local account (home directory C:/Users/me/ bamboo home C:/Users/me/bamboo-home/). Putting the keys under C:/Users/me/bamboo-home/.ssh does not work for me.

Deleted user January 23, 2013

@andrew-arminio - We needed to set the HOME environment variable to explicitely point to C:/Users/bamboo-home in order for SSH to locate the config and private key files under C:/Users/bamboo-home/.ssh. Our config file looks like

Host git.example.com
    User git
    IdentityFile /c/Users/me/bamboo-home/.ssh/bamboo_key

Joe Lipson January 1, 2015

Thanks this worked, but seriously, is this the only way to do it? Submodules seem to be poorly supported, I had a similar problem in Jenkins, at least there was a ssh agent plugin that git it working there.

0 votes
Jesse Sanford December 19, 2014

wtf. this is rediculous. copying sensitive key material to every build slave is asinine!

0 votes
Rafael Bodill January 16, 2013

@Mark Either name the private key "id_rsa" and place it in /home/bamboo/.ssh/
Or if you want it named differently, create a /home/bamboo/.ssh/config which will look like:

IdentityFile ~/.ssh/github_key

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events