This should be the easy bit!
I have Capistrano set up to deploy my app. I’m using a pack of
mongrels, so I’ve included the Ruby gem mongrel_cluster, including the
mongrel cluster recipes in my deploy.rb file.
From what I understand, I shoulc be able to define any task I like in
the deploy.rb file. I should then be able to run it with rake
I should also be able to create hook tasks - before_update_code and
after_update_code for example.
The behaviour I am getting is confusing.
Tasks I define don’t work - rake doesn’t ‘know how to build’ them.
Tasks I define ARE shown if I type ‘rake remote:show_tasks’
Tasks that are defined in the demo sections of the created deploy.rb
file show the same behaviour.
If I name a task something like ‘update_code’, it is visible in
show_tasks AND works.
If I try to call a task only defined in the mongrel recipes origibal
file by name, it doesn’t work.
The script works because it overrides things like ‘spinner’ and uses
them to call tasks like ‘start_mongrel_cluster’… So if I call a
defined task from inside a task, it might work.
My next steps will be:
1: Find the file deploy.rb is extending.
2: Find the ‘update_code’ task.
3: Copy it into my deploy.rb
4: Call ‘after_update_code’ explicitly from within it.
It shouldn’t be that hard! I also have a feeling SOMETHING will happen
to stop it working ;^). It’s been that kinda couple of days.
Does anyone know why this is happening? It happens if I deploy from my
Windoze box, or if I deploy from the linux server itself (from another
dir I checked out for testing with ‘on site’.)
Is it a new version problem? (I’m using the latest.) Is it a
configuration I haven’t done? Some instructions I’ve somehow missed?
The fact I created the deploy.rb file on Windows? Have I angered the
Please help. This is driving me absolutely nuts!