简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM