Deploying multiple projects/applications

264 views
Skip to first unread message

Nandz

unread,
Nov 15, 2007, 2:51:10 AM11/15/07
to Capistrano
I'm trying to use Cap2 to deploy non-Rails applications and am running
into probably an impedance mismatch.

Capistrano is build to checkout one project/application from SVN (or
whichever SCM) and deploy it onto remote servers. It assumes that this
single checkout/deploy step will cause the entire web application to
be deployed.

In my case, we have 6 difference web apps (each sitting in their own
folders in SVN). For the entire website to be functioning, I need all
6 webapps to be deployed and running. Whenever a new build is rolled
out, I need all 6 webapps to be updated.

I've written a custom task to handle this --

task :checkout do
get_defaults # initializes the $projects with the list of projects
deploy.setup
for project in $projects
set :repository, "http://agni.cleartrip.com/svn/repos/
#{project[0]}"
set :application, "#{project[1]}"
puts "#{application} -- #{repository}"
deploy.update_code
end

But with each iteration the same application is being checked out and
deployed! Upon digging deeper into the Capistrano code I found the
culprit:

def command
@command ||= case copy_strategy
when :checkout
source.checkout(revision, destination)
when :export
source.export(revision, destination)
end
end

Almost all private helper functions in copy.rb (the strategy which I'm
using) are written in this way. They don't compute commands/variable
values more than once.

Am I barking up the wrong tree? Is there a more elegant way of doing
this in Capistrano?

Saurabh.

Jamis Buck

unread,
Nov 15, 2007, 10:55:21 AM11/15/07
to capis...@googlegroups.com
In cases like this, I'd recommend bypassing Capistrano's built-in
deployment stuff altogether, and writing your own recipes. Instead of
"deploy.update_code", just do a call to run() with the command(s) you
need to move your project(s) to the servers.

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-
> unsub...@googlegroups.com
> For more options, visit this group at http://groups.google.com/
> group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

toby privett

unread,
Nov 15, 2007, 5:54:36 PM11/15/07
to capis...@googlegroups.com
I have a similar situation, needing to deploy multiple applications.
I'm using railsmachine, and want to keep using the deploy file the way
the gem creates it.

So I edited the Capfile to accept the application name (or "all apps")
as an input, and now call appname.deploy.rb. Works okay for now as I
haven't had to touch any other files.


--
Toby Privett
<< rorbar.com >>

marko

unread,
Nov 16, 2007, 4:38:51 AM11/16/07
to Capistrano
Jamis, how do you see Cappy in relation to other sys admin tools like
Puppet? I think Puppet sounds good, but the fact that it is not able
to work on Windows is a real negative. But, there seem to be some mis-
conceptions about Cappy's abilities (probably due to lack of
documentation) in this arena. Would you give your 2 cents worth about
how Cappy stacks up to Puppet, even if it is only a 5 min glance at
their FAQ and docs?

Thanks much in advance! For possibly looking at this, but mostly just
for providing such an awesome tool to the community.
> smime.p7s
> 3KDownload

Nicolas Chuche

unread,
Nov 16, 2007, 6:56:19 AM11/16/07
to capis...@googlegroups.com
Hello,

I work with cfengine (something like an old puppet's big brother as
it's almost 10 years old now) and capistrano (to deploy some and check
java/tomcat apps) and for me the difference is clear :
- cfengine likes are for maintaining an IT system on the long run. For
tasks that turn in the background, check things, start service, deploy
new system packages, ... without the sysadmin
- capistrano is more high level and more application oriented :
deploying application, restarting an apache, everything from one
single server (bastion one).

To summarize, when it must be in the background, it's cfengine/puppet,
when it's an operator task, capistrano.

That's only my opinion and my way of doing.

marko

unread,
Nov 20, 2007, 3:20:18 AM11/20/07
to Capistrano
Thanks for your opinion! I do appreciate it as I am doing research on
supporting a dozen or so Linux servers setup as a web farm. Outside
consultants are recommending Zenworks, but I tend to think this is
something that the OSS world has resolved. Will look more into
cfengine/puppet and see if I can figure that tool out to meet this
need.

Take care!
Reply all
Reply to author
Forward
0 new messages