Best practices to mount Rails engine to several apps on production

守給你的承諾、 提交于 2019-12-24 05:50:03

问题


I'm a little bit confused about organizing Rails applications and mountable engine in production.

I have N apps, which are using 1 mountable engine (it sets some cookies for apps).
In development it works this way.
Folders:

|— app1
|— app2
|— my_engine

In apps Gemfile:

gem 'my_engine', path: "../my_engine"

So all of the apps are mounting it from 1 source.
And I'd like to keep this logic in production.

On my vps apps organized this way (using Capistrano for deploy):

|—apps_folder
|— — app1
|— — — current (sym link)
|— — — releases
|— — — shared

|— — app2
|— — — current (sym link)
|— — — releases
|— — — shared

|— git
|— — app1.git
|— — app2.git

Can you describe me workflow: how to deploy my_engine to my production and connect it to all of the apps on the server. Thanks.


回答1:


Did you mean how to deploy the shared rails engine? If the shared the engine is mounted in each rails app, there is no need to deploy the engine alone. After deploy rails app to the production, running bundle install will install all the apps dependency, including the shared engine. This is what we did in our deployment.



来源:https://stackoverflow.com/questions/20720080/best-practices-to-mount-rails-engine-to-several-apps-on-production

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!