views:

40

answers:

2

I'm trying to deploy a rails app using vlad the deployer.

I'm using nginx and passenger.

I have an issue with the vlad:start_app task.

When I deploy I get the following issue

touch: cannot touch `/var/www/mysite.com/releases/20100623130302/tmp/restart.txt': No such file or directory
rake aborted!
execution failed with status 1: ssh mysite.com touch /var/www/mysite.com/releases/20100623130302/tmp/restart.txt

The issue is obvious in that the 20100623130302 in releases does not exist.

I would rather use the following task but cant override the default vlad:start_app task by placing this in my config/deploy.rb file.

namespace :vlad do

  desc 'Restart Passenger'
    remote_task :start_app do
    run "touch #{current_path}/tmp/restart.txt"
  end

end

Any help appreciated. The options I though of are to either get the default vlad task to work or someway to override the default vlad task.

A: 

RAILS_ROOT/Rakefile is the file.

Anand
I've already tried that however the vlad tasks are loaded from the vlad gem like... begin require "vlad" Vlad.load(:app => :passenger, :scm => "git") rescue LoadError => e puts "Unable to load Vlad #{e}." endAlso remote_task is something loaded with vlad so tasks cant be defined using remote_task until vlad is loaded at which point come the existing vlad:start_app task also!
Paul Carey
A: 

To override a task you have to remove the previous one first as defining the same task again just creates a second task that will run after the first one.

Here's an example from the vlad website how to replace a task:

namespace :vlad do
  # Clear existing update task so that we can redefine instead of adding to it.
  Rake.clear_tasks('vlad:update')

  remote_task :update, :roles => :app do
    #custom update stuff
  end
end
Tomas Markauskas