Using git submodules through ssh with Bamboo

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

This widget could not be displayed.

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,

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.

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 ?

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.

@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.

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

@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

@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?

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.

@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

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.

This widget could not be displayed.

@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

This widget could not be displayed.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

83 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you