Forum: Ruby on Rails Capistrano: creating your own tasks

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-03-22 00:52
(Received via mailing list)
When I create a task within capistrano.rb I can call it using rake.

When I create a task and put it in deploy.rb I can call it.  Neither
with or without the remote: namespace.

Anyone have any insight into why it does not work?

John Kopanas
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-03-22 06:24
(Received via mailing list)
On Mar 21, 2006, at 4:52 PM, John Kopanas wrote:

> When I create a task within capistrano.rb I can call it using rake.
>
> When I create a task and put it in deploy.rb I can call it.
> Neither with or without the remote: namespace.
>
> Anyone have any insight into why it does not work?

Above, you say "I can call it". Do you mean "can't"?

First, you need to be sure and keep "rake tasks" and "cap tasks"
separate. Rake cannot execute capistrano tasks directly. Capistrano
cannot invoke rake tasks directly.

If you have a capistrano task, it needs to go in deploy.rb. If you
want to be able to invoke it via rake, you then need to add a wrapper
for it in lib/tasks/capistrano.rake.

Try this. In config/deploy.rb, add the following:

   task :test_task do
     puts "IT'S ALIVE!!!"
   end

Then, type:

   cap test_task

Do you see the "IT'S ALIVE" message?

- Jamis
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-03-22 17:55
(Received via mailing list)
Again Jamis, thanks a lot.  I now have a perfectly customized task to
upload my website. Sweet! :-)

On 22-Mar-06, at 12:23 AM, Jamis Buck wrote:

>
>   task :test_task do
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails


John Kopanas
This topic is locked and can not be replied to.