Tuesday, December 17, 2013

Make TeamCity to work with git submodule

Recently I'm using TeamCity to build .ipa automatically from github, however when I ran project in TeamCity and came to the step checkout files into agent, it always reported an error:
Clone of 'git@github.com:cocos2d/cocos2d-html5.git' into submodule path 'external/cocos2d-html5' failed
I checked the account authority and even cloned files via terminal git, all things run well. So it mustn't be the authority problem.

At last this error was solved by changing git from SSH to HTTPS access.

1. Edit .gitmodules file in the root project, change the addresses of submodules to HTTPS addresses

2. Change directory in every submodule, set fetch and push address to HTTPS
cd $submodule
git remote -v
git remote origin set-url https://github.com/your_git_address

And then TeamCity works properly.

1 comment: