mirror of
https://github.com/moghtech/komodo.git
synced 2025-12-05 19:17:36 -06:00
[Feature] recursive clone for git submodules #289
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Selovert on GitHub (Apr 15, 2025).
I've got a build that is done from a repo with a submodule. Looks like the submodule is not being cloned in at the time of build, which breaks things.
Would also be fine with a workaround if one exists!
@Ga22be commented on GitHub (Jun 8, 2025):
Agreed, I just hit this issue while setting up a stack.
First I figured that just adding the submodule sync and update as commands in the pre-deploy commands could suffice, but this misses out on the repository token and fails on authorization.
Having looked at the code I figure that an additional step in the
pull.rsfile is probably the way to go. I'm not a rust developer however so making a PR isn't trivial. Maybe check that a.gitmodulesexists before doing any submodule stuff.@jochemvangrondelle commented on GitHub (Jun 29, 2025):
Upvoting this - komo.do is amazing!
Ideal setup is separate repos for each server with gpg and pubkeys, but then having them added as submodules to one bigger repo for Komodo that can also include common resource configs across services. But not a blocker - can work with separate repos, but if it's an easy fix to fetch recursively, would be already amazing, and then pushing changes directly to the nested submodules even more cool.
@Ga22be commented on GitHub (Jun 29, 2025):
I did solve my issue in the end by removing my submodule and adding a separate repo in the komodo interface which I then reference by path in my stack config. I do not get the ability to lock the "submodule" revision in git the same way, which has caused some headaches. So it is not nearly as clean but a workable workaround in the mean time. I'd still love submodule support to be added when convenient.
@mbecker20 commented on GitHub (Jul 1, 2025):
You can add your git access token as a Variable or Secret, and use it in the Pre Deploy / On Clone commands via interpolation, for example https://token:GIT_TOKEN@github.com/.../...
@Ga22be commented on GitHub (Jul 14, 2025):
For anyone else wanting to work around this I suggest the following in the Pre Deploy hook of your stack. All based on @mbecker20's suggestion. Kudos!
This will overwrite your submodule URL and allow you to use a secret that you have specified in the Komodo secret store.
@Selovert commented on GitHub (Aug 4, 2025):
Thanks, all! Ended up with a slightly-tweaked version of what @mbecker20 and @Ga22be came up with.
I set up my repository as a Repo Resource in Komodo 1.18.4. Config below:
On Clone
On Pull