Get last commit from git submodules

Hello,

I use a git repository which has several submodules.

For the daily build, Teamcity should use the latest commits from the repository and all submodules. But Teamcity only gets the latest commit from the superproject. From the submodule, it only uses the commits where the superproject refers to.

Is it possible to configure Teamcity to use the latest commit of each submodule?

Thanks and best regards,

Heiko

0
2 comments

Hi Heiko,

If the project has the submodules pointing at some commits, then that's the information that we have to work with. There is usually a pretty simple solution which is, instead of using submodules, add the further repositories as VCS Roots as well, and use checkout rules to load all the data into the appropriate folders. This allows you a more granular control, as you can also decide whether to trigger on changes of the submodules or only on changes on the main root.

0
Avatar
Permanently deleted user

Hi Denis,

 

thank you for your feedback.

An other solution is to add a build step (command line) which calls %env.TEAMCITY_GIT_PATH% and updates the submodules.

But actually I was looking for a solution that does that automatically...

 

Best regards,

Heiko

0

Please sign in to leave a comment.