We use Chef to set up our servers, but I'm looking for a way to consolidate our server dependencies into a single config file that lives in source control.
We use capistrano for deployments, a custom build script for continuous integration, and now we want a Nagios poll to check that all dependencies are present (rvm installed, correct ruby version, gems installed, etc.)
This means that we would be duplicating the dependency config in 3 places, and I would like to refactor this. I want to be able to use the same code from both my deploy script and my build script, to handle the installation of packages and setting up the environment. We were thinking about using our capistrano scripts within the build script, but that seems too convoluted. I'm also looking for code that can inspect the environment and check that it meets the app's requirements.
I image that the configuration would be something like .environment.yml in the root directory of the application. The scripts could be something like './script/environment setup' and './script/environment check'.
I'm posting this as a question because I don't want to reinvent the wheel. I would like to ask if there is already a convention in place, or if anyone has any better suggestions.
for the things that you mention, maintain a config in my repo, i use puppet http://puppetlabs.com/ ideal because puppet is configured not like capistrano, where you say how in puppet, you say what, and puppet do the work.
You could (and probably should) use
include
recipe statements in your Ruby apps.If you're talking about mandatory gems, you could include a gemfile in your application.
One of the problems with Chef (and likely Puppet, too) is that there are many "right" ways of doing things, and it's hard to know which is "most right" for your situation.