Bamboo Git and Gitolite setup

We are using gitolite to manage our central Git repository ( I wish we could move to stash, but it's not an option at the moment). The current process to clone a git repo in gitolite looks like :

git clone git@hostname:repo.git

where hostname is one of the host in our domain. Gitolite handles authentication via ssh keys stored in a gitolite repo. Doing a simple ssh git@hostname lists all the repos accessible. From a user perspective, we just need to have our rsa pubic key in the gitolite repo and that's it - no pwd to provide.

I can't get Bamboo to use one of the gitolite repository for cloning - the plan either:

* errors out before starting the build : (when specifying git as the username)

Error encountered while triggering manual build: com.atlassian.bamboo.repository.RepositoryException: myhost02:my_proj.git: Auth fail
Plan 'MYPROJ-TEST' did not start

* fails to checkout during the build (when attaching the private key to the git repository configuration)

fatal: The remote end hung up unexpectedly
09-Aug-2012 15:25:36	Error occurred while running Task 'Checkout Default Repository(3)'. This build will fail. Caused by:
09-Aug-2012 15:25:36	java.lang.RuntimeException: com.atlassian.bamboo.plugins.git.GitCommandException: command [/usr/local/bin/git, fetch, ssh://077b1e06-2a79-4b53-a967-7bb858646187@127.0.0.1:34552/my_project.git, +refs/heads/dev:refs/heads/dev, --update-head-ok] failed. Working directory was `/home/user/bamboo/myagent05/xml-data/build-dir/MYPROJ-TEST-JOB1'. stderr: SSH Proxy error: Error starting ssh client stdout: [git@myhost02/10.236.120.112:22] Error starting ssh client: Session is closedfatal: The remote end hung up unexpectedly
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:119)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:79)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:174)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:97)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:180)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:64)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:66)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:202)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:109)
09-Aug-2012 15:25:36	        at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
09-Aug-2012 15:25:36	        at

2 answers

1 vote

The second case looks like a bug that we've fixed in Bamboo 4.2 (which should be released in a matter of days). For the time being, are you able to specify the repository address in a format other than git@hostname:repo.git ?

For example git@hostname:/full/path/to/repo.git

or

git@hostname:/~/repo.git

or

git@hostname:/~username/repo.git

?

none of the options work :(

I'll try on the dev server and will keep you posted.

OK, can you upgrade to 4.2?

it works as expected with Bamboo 4.2 - we'll work out the transition.

:) we also use gitolite for our git repositories.

The biggest pain in the butt is that you have to add the openssh private key to the repository definition in the plan.

You can set the repository location to ssh://git@mygitservername/path/to/the/repo.git'

notice that I dont have a ":" in there...

But I would say the best thing is to look at the format of the url (since the format I just provided works with our bamboo to hit our gitolite instance) and to make sure that a correct openssh formatted private key is added to the plan's repository definition (bamboo ignores ~/.ssh/id_rsa and doesnt process ~/.ssh/config)

Thanks to Roy Lyons.

Resolved with your instructions.

Now Bamboo does gitolite.

Suggest an answer

Log in or Join to answer
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,096 views 0 5
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot