Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple repositories and Heroku

Tags:

git

heroku

web

I have two git repositories (frontend and backend). Say, i need to push frontend to heroku and don't touch backend. Simple static files update, right? Should be easy. But it's not. I have to manually put my static files from frontend into backend repository and push backend to heroku. Then wait for build, env install etc. All this just to upload some files. Is there another way? Maybe some manipulations with git submodule or something like that?

like image 993
Andrey Avatar asked Jul 29 '16 23:07

Andrey


People also ask

Can you have multiple repositories?

With Git, using multiple repositories is the only way to work efficiently. This enables each team to work independently, and do their work faster. You can also make sure that developers only have access to the repositories they need access to (thus making Git more secure.)

When should I use multiple repositories?

Having multiple repositories makes it easy to give access to subsets of repositories on a “need to code” basis. I set up Continuous Deployment for my projects. It's much easier to let each repository have it's own process for being deployed.

Can I have multiple Git repositories in one folder?

gitignore file. But sometimes there are situations where we might want to do something even fancier: Have some files of a directory in one repository, and others in another repository. This is not only possible, it's surprisingly easy and doesn't require complex Git knowledge with figures showing graphs, branches, etc.

Can I merge 2 repos?

To combine two separate Git repositories into one, add the repository to merge in as a remote to the repository to merge into. Then, combine their histories by merging while using the --allow-unrelated-histories command line option.


1 Answers

From what i've learned: The right way to do this is to have multiple heroku apps. It's kind of heroku's pattern. Build an app for each of your microservices. So e.g. you will have frontend app at web.yourdomain.com, auth microservice at auth.yourdomain.com, long-polling server at updates.yourdomain.com etc. Or you can redirect all requests from clients via api.yourdomain.com.

Point is, you have multiple repositories for multiple apps. That seems to be it.

like image 135
Andrey Avatar answered Oct 21 '22 20:10

Andrey