Question

I'm trying to develop a Django reusable app and a project that uses it. They are in two separate git repositories. The goal is to make it easy to change the code of both the project and the app, and deploy that code to Heroku.

Right now, I've set up the requirements.txt of the project to include the line

https://github.com/me/my-reusable-app/tarball/master

So, theoretically, I can work on my reusable app, push the changes to github, and then deploy from the project directory. However, Heroku doesn't seem to notice when I have made changes to my-reusable-app. Even when I change the project, check in the changes, and then run git push heroku master, forcing a rebuild, it doesn't seem to catch the updates from GitHub.

Is there a better way of doing this? For instance, would it be better to make the app a git submodule of the project, rather than having a dependency in requirements.txt? Or I could also deploy without git, using this tool. Finally, I could give up on the app being reusable, and just move the two git repositories together.

Was it helpful?

Solution

I would recommend a Git submodule.

I am successfully using this approach to include Twitter Bootstrap source code into a Django application on Heroku, and since submodules are widely understood (if not universally liked) other developers should have minimal trouble getting up to speed.

But of course there are other options. This Heroku article suggests four, including the one I recommend:

  • Git submodules,
  • "protected" Git submodules that require credentials for cloning,
  • using a vendor/ directory, and
  • private package repositories.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top