Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Submodules with Heroku

The Problem

I have a Rails 3.1 app on Heroku which will soon require a bunch of (3rd party) submodules (some of which have submodules). Unfortunately, Heroku lacks submodule support. One suggestion on Heroku's website is to move the contents of the submodules into the main repo (here). This will work fine the first time, but there is a possibility that it won't the second. This could be caused by a major update in one of the third party submodules where a fast forward merge is unsuccessful. Obviously we can't manually merge a third party project.

The "Solution"

Our tentative solution is as follows:

  1. Create a new 'temp' branch based on the latest stable dev branch and merge the submodules into the project.
  2. Checkout to a heroku branch.
  3. Nuke the contents of this heroku branch to avoid any possible conflicts, i.e. create a commit with everything deleted.
  4. Merge the temp branch into the heroku branch.
  5. Push this heroku branch to our Heroku server.

The Advantages

This will avoid any possible conflicts in third party submodules and is scriptable.

The Disadvantages

This is extremely inelegant and is the ultimate anti-pattern for SVC.

The Question

Is there a better way to do this?

like image 864
Ben Sand Avatar asked Nov 20 '11 09:11

Ben Sand


1 Answers

Heroku now supports submodules.

http://devcenter.heroku.com/articles/git-submodules

However, this feature does not support submodules that are private.

like image 171
Spike Avatar answered Oct 12 '22 20:10

Spike