Capistrano and Drupal

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Bèr Kessels's picture

Using Capistrano for Drupal deploying. Sounds cool, and should be possible. Lets talk about hos this should be done, and if this is feasible.
I plan to drop the sympal-scripts -which, in fact want to be a capistrano-only-for-drupal-in-PHP- in favour of a good working capistrano drupal thingie.

Comments

Bèr Kessels's picture

So to answer your question, I have no experience in using Capistrano.
Deploying Drupal via Capistrano is a theory that I would like to test out
soon. I figure if it's works for Wordpress, it's worth a try with Drupal.
Some decent supporting documentation:

The directory structure requirements may be harder to deal with, but I'm
going to see what I can do. The ability to use tasks may give me more power
than I'm currently aware of.

As I said earlier, the reason I'm looking for something else is that anon
CVS wasn't working on one of the hosts. I'm trying to find an alternate way
to make deployment easier. If this doesn't work, I'm thinking of using
mercurial or bzr to hold the site configurations and do a push to the
different hosts.

I'm not a Rails fanboy (I did try it, but couldn't grok it), but I am
jealous of their tools like gems, and rake w/ capistrano. I would like to
see Drupal use a package manager, and I would rather not reinvent the wheel
to do it. I know a dependency system is needed before this can happen, but
with the install/uninstall hooks being added, dependencies will be the
(eventual) natural evolution.

-cb

On 9/15/06, Bèr Kessels <ber@***> wrote:
>

Op vrijdag 15 september 2006 02:28, schreef u:

Bèr,
I'm a lurker on the drupal development mailing list. I've been
interested in your Sympal Scripts, and I was wondering how are they
working
out for you? I've noticed that there haven't been any CVS commits in a
few
weeks on the project. Are they "scratching your itch" well enough, or
have
you resigned to an alternative?

Sorry for all the questions. I am trying to find something to make
updates
easier for me to do for some clients I have on different
hosts. Anonymous
CVS has not been working for me. I was considering using Capistrano to
do
it, but I remebered your scripts.

How much functionality do they offer compared to Capistrano?

I must admit that I never really looked into Capistrano with the idea of
it
being a competitor of Sympal, until now!

Capistrano is far more mature, wider spread and better known. Capistrano
is in
Ruby.

However, reading http://manuals.rubyonrails.com/read/chapter/97#page258

You are using Ruby on Rails to develop your application.
* No, Drupal is PHP and far from RoR.
You are using subversion to manage your source code.
* No, Drupal uses CVS (I have sympal in SVN though)
You are deploying your application to "/u/apps/#{appname}" on every
machine.
* No, Drupal (And Sympal scripts) use #{appname}/sites/#{sitename}
You are using FastCGI to power your application.
* Nope, AFAIK Drupal won't even run on FastCGI properly
You are fronting your app with either lighttpd or apache.
* Apache, yes.

So it seems that eventhough Capistrano is a front-end for web-apps, it is
far
from Drupal Savvy.

Sympal scripts are Drupal only, thus have a smaller reach, and less
eyeballs.
They are still rather messy, being alpha and all. They are usable though,
even
if only as basis.

The 1.0 of Sympal scripts should do this: http://webschuur.com/node/637

Right now I am setting up a new vhost debian server, using virtualmin, and
I
am playing with ispconfig. One of both should get front-ends to Sympal
Scripts. This is the reason for the relative silence: I am actually
deploying
the scripts to see where they should be improved Right Now.

Right, so I have a question for you: Have you got experience with
Capistrano,
are you familiar with it, or its developers? How hard would it be to mould
CApistrano into a Drupal savvy system?
If it is not that hard then i'll remove the sympal scripts today, and move
over to Capistrano tomorrow :) Joining forces with you and others could
help
us get this Real actually!

What do you think?

--
[ Bèr Kessels | Drupal services www.webschuur.com ]

FastCGI on Drupal, Okay!

adixon's picture

Not really on your topic, which is good, but so as to prevent false rumours - FastCGI and Drupal have worked together fine in my experience (and others', i've heard).

Checking out capistrano now ..

Thanks - and a great idea

cbooth7575's picture

Thanks for the links on using Capistrano with other PHP-based systems. I discovered RoR about 6 months ago, and love it, but am now putting together a Drupal project. Being new to Drupal, I'm trying to find ways to keep some of the things I love best about working in RoR in place.

In addition to Capistrano, I'd love to find some way to bring migrations over to my PHP projects, and also testing (unit/integration). Both of them are also key features in Rails, that have shifted the way I maintain live sites, and develop projects, for the better, and I'll miss them if I can find decent substitutes ;-)

I'll post here what I do learn, when I'm able to...

Cameron

About Migrations:

Bèr Kessels's picture

I've done tests and proof of concepts on this matter. So you might be interested in my post(s) on sympal scripts.

To be precise, the following goal in the 'manual' may be interesting:

extract.php        Create fixtures from a site.
 --site www.example.com      The site to extract.
 --fixtures  directory-name  Write the fixtures to the directory directory-name.

Could you explain

pearcec's picture

What a Symbal script is? ANd what creating a fixtures from a site would do? How does this help us for migrations? To me that is about the only thing missing for me, that would keep me from using capistrano.

--
Christian

--
Christian

Rails

panama's picture

Cameron;

I'm about to make a technology decision, drupal or rails. Your comment suggest that you may be an objective resource. Perhaps you have some thoughts that could help. The site I'm planning will be an industry portal, with archives, articles, documents for download, news feeds, a blog and a discussion forum. More importantly there will be significant interactive functions, buying, selling and trading. My impulse is to go with rails for the ability to customize, but Drupal has many of the required functions plus more already in place.

If you were considering such, would you Drupal or Rail. Or use a combo and why. Make any assumptions you wish.

Thanks for considering my questions

Panama

Good idea

jystewart's picture

I'm primarily developing with Rails these days but have a few clients for whom I use drupal. I'd love to see Capistrano working with drupal.

When I work on a drupal app I tend to store my 'sites/default' folder in subversion and check that out into a download of the latest drupal release. I'd love to be able to use capistrano to automate that, along with

  • shared 'files' folder between versions
  • some sort of database migrations system to allow merger of the production and development databases

update: and request for support :)

Bèr Kessels's picture

I have started playing with capistrano, mostly trying to distribute, and install a sillly little rails APP I wrote for this purpose.

I am gettign the feeling, and I am liking it a lot.

If people are familiar with capistrano, I would love to hearfrom them, so that we can get this rolling earlier :)

Initial attempt

jystewart's picture

I finally got fed up of updating drupal sites by hand and made a stab at using capistrano to manage deployments. So far it seems to work pretty well with a single site per drupal install, and should be pretty easy to scale to multiple sites. I wrote it up at:

http://jystewart.net/process/archives/2007/02/using-capistrano-for-drupa...

Create a task library for Drupal?

pearcec's picture

I started work on a task library that overrides some of the default tasks to do more sensible actions for a drupal installation. So far so good.

Anyone interested in helping?

I would like to make a gem, but don't think I will host it on rubyforge. I think we can just host it here. Where can i put the code?

I should also note I never deployed a rails app with capistrano, so I lack experience in that realm. So I could use some help with best practice from a capistrano perspective

--
Christian

--
Christian

We use Drupal + Capistrano

Chiaroscuro's picture

We are Rails people that use Drupal for CMS jobs and also for several social networks implementations.

We use Capistrano to handle the deploy. You can read about it (and find the recipes) here: http://blog.mikamai.com/2008/07/sweeter-nicer-drupal-with-capistrano/

Thank you! I am trying

SamRose's picture

Thank you! I am trying something similar right now.

Sam Rose
Social Synergy
Open Source Ecology
P2P Foundation

AutoPilot module?

BartVB's picture

Just ran into this:

http://drupal.org/project/autopilot

No experience with it but it also tries to deal with deployment of Drupal from testing to staging to production.

capistrano-drupal gem

kim.pepper's picture

I've created a gem that contains most of the logic for deploying Drupal sites using capistrano. It's an early release and based mostly on the defaults that we use internally, but it may help others to roll their own.

You can get it at: http://github.com/previousnext/capsitrano-drupal

The gem is on rubygems.org at: http://rubygems.org/gems/capistrano-drupal

Kim

Deploying Drupal with Webistrano

gaspaio's picture

I just published a recipe that overrides the default deploy namespace definitions in capistrano for Drupal website deploys. It is meant to be used inside webistrano, so that the visible action links work.

You can find it on github : https://github.com/gaspaio/Drupal-Capistrano-Deploy

I hope somebody finds this usefull. Feedback most welcome.

Capistrano and Drush Make

pearcec's picture

I have done a lot of reading and haven't found anyone that addressed this.

We use drush make. We live by it. We have toyed with AEgir and decided it doesn't fit our model.

We want to get back to using Capistrano and Drush make. Ideally we use drush make to push out new versions from the drush make file automatically. Traditionally people check their codebase into version control. We don't we push in makefiles. Has anyone given this thought or made it work? Automating this would solve some of the tedious aspect to deploying and working with code.

--
Christian

This has been long over

pearcec's picture

This has been long over due

https://rubygems.org/gems/capistrano-drush-make
https://github.com/xforty/capistrano-drush-make

I highly encourage anyone who is using drush makefiles and capsitrano to join me on github so we can improve this. Right now it sits on top of capistrano-ash. That RubyGem is a fine start. But it combines to many frameworks into a single gem for no good reason. I would like to slowly replace capistrano-drush-make with it's own tasks and then eliminate the ash gem all together.

One of the first items for improvement is using the sites/default directory isn't a concept that exists. What i did was to create a symbol :default_multisite. This links over to a multisite directory of choice. If you only have one site, you need to fudge your setup to use it. I would like people to test it and offer suggestions. I will do my best to code them up. Patches welcome.

--
Christian

Capistrano pluging for drupal

gagarine's picture

A capistrano 3 drupal plugin: https://github.com/capistrano/drupal-deploy. You can sync files, open an interactive cli, run any drush command, revert features... and of course deploy.

And an old capistrano 2 https://github.com/antistatique/capdrupal

Ruby (on rails) for Drupal

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week