Further, new IT policy changes have taken away developer's sudo access on these servers, which makes developing cumbersome and difficult - having to go through IT for every environment update request.
So I set upon the task of developing an easy way to deploy each application in its own environment.
Following are the goals I wanted to achieve:
- Each application runs in its own deployment environment. By environment I mean a complete directory structure that has its own ruby and gem installation, along with any additional software such as database, web server, Imagemagick, reverse proxy etc.
- The environment should be easy to duplicate for staging and development, thus keeping the production environment isolated until QA is done and the application is ready to be deployed in production
- The environment should be easy to build - fire off a script and go get a coffee while the environment is being built and configured.
I came upon Marcus Crafter's sprinkle which allows easy provisioning of new VPS systems. It is an awesome piece of code that makes setting up new systems a breeze.
Sprinkle is a new prototype tool that you can use to provision your servers/slices. Its declarative policy/state based approach for specifying how a remote system should be provisioned with intelligent logic to support dependencies, multiple installer types and remote installation is really compelling.
The ruby based DSL used to describe the provisioning setup is easy to understand and maintain.
However, sprinkle in its current form provisioned the entire system to a specific deployment environment - not what I had in mind.
So I created a fork of the sprinkle codebase on github and added the capability to build local deployment directories to sprinkle.
Here is a log of the functionality I added:
To get started with this new functionality:
- Install the sprinkle gem.
- git clone git://github.com/cpatil/sprinkle.git
- cd sprinkle
- gem build sprinkle.gemspec
- gem install sprinkle.gemspec - Create a sprinkle recipe (download)
- Run sprinkle and go get a coffee
- sprinkle -c - v -d deploy_dir -s build_deployment_env.rb - Source the env.
- source deploy_dir/source_env.tcsh - Test the paths
- which ruby
- which gem
- gem list
Now cd to your rails application dir and start up the server - Voila - custom a la carte deployment environments :)
Njoy!
No comments:
Post a Comment