The Agile Developer

« Back to blog
 

Enterprise Capistrano: Deploying to Servers With Unique Credentials

Capistrano makes an assumption that all servers in your application stack
share the same credentials. As much logical sense as this makes, in large
enterprise landscapes it is often not a reality. The nature of this world
(Enterprise) is that trying to shift the mindset of all shareholders
(infrastructure, support teams, security, etc) and then changing long running
practices is not always feasible. This is especially true when doing so on
numerous severs servicing numerous other systems that depend on the already in
place mismatched credentials. For us...we have our normal application servers
and database servers that DO share matching credentials. But along with them
we use a separate server env to store and host our assets (images, css, js)
with its own credentials.

Still desiring to leverage capistrano for its core automation benefits we had
to monkey-patch capistrano so we could supply server specific username and
passwords. Drop this in your lib folder or somewhere else more relevant.
WARNING: This is basically cut-paste from the capistrano internals with some
added sugar - I take no responsibility for the class design and multiple
responsibilities in this rather big method.

This is a core class in the capistrano library. it is overridden so that we can support servers that have different user names and passwords

Your capfile will look something similar to this:

Posted
0 Comments

Leave a comment...

Theme by Cory Watilo.
More great Posterous themes at themes.posterous.com.