Almost four months later a found a nice strategy for having different
instances of the same application running.
I put everything I could configuration wise in the database, I'm absolutely
on par with Ignacio's opinion here.
But I had some problems left, the main ones this strategy copes with are
- Configurations (database.yml, application.yml)
- Gems used (Gemfile)
- Different taglibs (within and outside of Gems)
- I don't wont to increase the amount of deployment infrastructure (I
just use git and pull on the servers manually)
- I don't want to have lot's of extra steps on deployment (copying files
in and out before pulling was error prone on instances touched rarely)
The approach is as follows:
- Each instance get's an extra git repositoy
- This repository mirrors contains all the relevant Files (currently
just the ones mentioned above)
- This repository is deployed to /vendor/customer within the app
structure (/vendor/customer needs to be in the app's .gitignore)
- The file in the standard app location is replaced with a soft ink to
that file (ln -s ...)
This work nice, but there are two special cases:
1. On a development machine I want to have all of them switch-able
- So on each development machine there is an extra /vendor/customers
(also in .gitignore) which contains on directory for each instance
existing
- /vendor/customer soft inks to the currently developed or tested or
simulated instance /vendor/customers/name_of_the/instance
2. Instance or Gem specific taglibs
- It is not allowed to nest <include> in an <if test = "&..." >
- A <include if="&..." > doesn't cause an error per se, but the if is
ignored. So in instances where the Gem is not there or the taglib is not
deployed, an error complaining on the missing file is raised.
- This can be fixed by another indirection, the app includes <include
src="../../../vendor/customer/my-taglib"/>
- Instances using the taglib <include> further in that file: <include
src="../../vendor/engines/gemname/app/views/taglibs/whatever/*"/>
- Instances not using the taglib are stopped from propagation
there: <!-- gem or taglib not used here, no taglibs included -->
That sounds complicated. But in my case it's currently just 6 files + 6
links per instance which is still manageable.
Deployment means pulling one extra repository, in case the config changes
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.