Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On Heroku, how to deploy Rails app that is not in root directory of git repo?

How does one deploy a rails application on Heroku when the Rails code doesn't sit at the root of the git repository?

We're hoping to bring in a couple of thick javascript clients into the same repository as our rails app to aid with dependency management and interrelated build tools. Ideally, this will result in an git repository with a directory structure that looks like:

/repo
  /rails
    /app
    /config
    / ...
  /admin
    /..emberstuff
  /agent
    /..emberstuff

Unfortunately this isn't supported (that I can tell) by default in Heroku.

like image 933
Ivar Avatar asked Sep 28 '22 12:09

Ivar


1 Answers

You can control how the processes spawn using the Procfile in Heroku. You can see that here: https://devcenter.heroku.com/articles/procfile. If you commit a Procfile into your root directory this will control how your app spawns. Bear in mind, you can use shell in your procfile, too. For example:

myprocess: sh -c 'cd ./rails/ && exec name'

as per your structure above.

Hope that helps.

like image 94
jldb Avatar answered Oct 18 '22 12:10

jldb