TeamCity + git and authentication for submodules

Previously posted to Stackoverflow, but with no luck:

Trying to configure TeamCity to build our project, I'm having trouble getting the git VCS module to checkout a submodule. The submodule should be checked out using the same authentication as the root module, but I cannot figure out how to configure TeamCity for this. I have tried both password and private key authentication, but they both fail:

[12:07:14]: Patch is broken, can be found in file: C:\TeamCity\buildAgent\temp\cache\temp8149231956777659708patch_48
[12:07:14]: RunBuildException when running build stage UpdateSourcesFromServer: Failed to build patch for build 31 {build id=48}, VCS root: ssh://host/repo#master {id=2}, due to error: Patch building failed: 
jetbrains.buildServer.buildTriggers.vcs.git.submodules.SubmoduleFetchException: Cannot fetch submodule. Repository URL: 'ssh://*****@host/repo', submodule path: 'subrepo'.
org.eclipse.jgit.errors.TransportException: ssh://*****@host/subrepo: Auth fail
com.jcraft.jsch.JSchException: Auth fail


TeamCity runs on a windows machine and the git repos are on a linux machine. I want to build the revision of the submodule that is referenced by the main project (not necessarily HEAD of the submodule repo).

Is it possible to configure authentication for submodules in TeamCity, or can anyone come up with a good workaround?

6 comments
Comment actions Permalink

Hi Markus,

when TeamCity checks out git submodules it uses the same auth settings as in the main root, so it should work out of box.
Could you please check is clone using native git from command line work OK on the server machine?

0
Comment actions Permalink

I just checked out the repository, including the submodule module, using msysgit:

# git clone ssh://robot@host/repo
# cd repo
# git submodule init
# git submodule update

I noticed that the last command asked me for the password twice. I don't know if that is a problem ...

Other than that the checkout worked fine.

0
Comment actions Permalink

Upgrading to TeamCity 6 fixed the issue, now the whole project checks out fine. Next step is to fix the build :)

0
Comment actions Permalink

Yes, previous version of TeamCity has some problems with submodules, I'm glad that upgrade helped.

0
Comment actions Permalink

Is it possible to set different user/password for a git submodule in TeamCity? I would really need this.

0
Comment actions Permalink

It is not possible at the moment, please watch/vote for https://youtrack.jetbrains.com/issue/TW-29375

0

Please sign in to leave a comment.