Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top