Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku automatic push to github with submodules

Tags:

git

github

heroku

Heroku offers a beautiful deploy to from github to heroku automatically:

Automatic deploy

But it also says:

GitHub repos that use submodules will generally not deploy correctly on Heroku. This is because GitHub does not include submodule contents when repo-content tarballs are generated.

Does that mean there is no workaround if I have submodules?

For now the feature simply becomes useless.

I find their message very short and sharp, especially when they actually recommend to use submodules.

Can't they trigger a git push heroku master? And/or at least to keep the former submodule content (so that it works when the submodule is unchanged, which is 99% of the cases). Or should I provide access to the submodule content to heroku?

Any feedback will be appreciated.

like image 948
Augustin Riedinger Avatar asked Aug 08 '26 09:08

Augustin Riedinger


1 Answers

Indeed, a GIT push is not what is performed when using GitHub Sync. Instead, the platform api is used.
That API endpoint takes a tarball URL and deploys it on the app.

The tarball provided by GitHub doesn't include the content of the GIT repository. Only the app. It is therefore impossible to retrieve that content and include the repository there.

I have setup a buildpack which will do this for you though: https://github.com/dmathieu/heroku-buildpack-submodules

It will parse your .gitmodules content and install all submodules during your build, not caring whether there is a .git folder or not present.

like image 179
Damien MATHIEU Avatar answered Aug 11 '26 01:08

Damien MATHIEU



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!