mmm yes is a typo, but that's not the cause of malfunctioning 

Look another example of this behaviour, just one stripped version of some 
deploy I'm building now:

Capfile:
require 'capistrano/setup'
require 'capistrano/deploy'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }


config/deploy.rb

lock '3.2.1'

set :application, 'my_app_name'
set :repo_url, 'asecretrepo.git'

namespace :deploy do
  desc 'Installs missing software'
  task :install do
    puts "Begin install"
  end
end

#after 'deploy:install', 'base:install'  # this will work here if 
uncommented

lib/capistrano/tasks/base.rake 

namespace :base do
  desc "base install"
  task :install do
    on roles(:all) do
      puts 'aptitude update'
    end
  end
end

after 'deploy:install', 'base:install'  # this won't work here


This as it is, gives simply on a cap -vT

$ cap -vT
cap aborted!
Don't know how to build task 'deploy:install'
/home/carlos/capifu/lib/capistrano/tasks/base.rake:10:in `<top (required)>'

But if you comment after in the rake task and uncomment the one in the 
config/deploy.rb it'll work as expected. But makes more sense specify the 
after/before hooks within the taks we want to be fired and not in another 
file.

Could this bi a limitation of the chosen "rake" path? or there's another 
way to do this?

On Tuesday, 30 September 2014 14:49:27 UTC+2, Bruno Sutic wrote:
>
> It seems you have a typo in the first code snippet above:
>
> namespace deploy do
>   task :restart do
>      ....
>   end
> end
>
> The `namespace deploy` => deploy should be a symbol so try changing it to 
> this: `namespace :deploy`
>
> On Thursday, July 10, 2014 2:31:53 AM UTC+2, Carlos Peñas wrote:
>>
>> Hi!.
>>
>> I'm running in to the dared "cap aborted! Don't know how to build task 
>> '<task>'"
>>
>> And I do not know if I'm missing something and is a feature or there's 
>> other way to get this
>>
>> supose this deploy.rb
>>
>> #after "deploy:restart", "clean:cache"
>>
>> namespace deploy do
>>   task :restart do
>>      ....
>>   end
>> end
>>
>> after "deploy:restart", "clean:cache"
>>
>> and this lib/capistrano/tasks/clean.rake
>>
>> namespace :clean do
>>   task :cache do
>>     ...
>>   end
>> end
>>
>> #after "deploy:restart", "clean:cache"
>>
>> all of these with the default Capfile which includes all the rake files 
>> in lib/capistrano
>>
>> Documentation states that I  can put the after chain wherever it suits my 
>> needs (and I need to place it in the rake file) But it only works if I 
>> place it at the end of deploy.rb. Otherwise capistrano behaves like if task 
>> was undefined. This brings me to the old #include <stdio.h> times
>>
>> is there a way to put after chain in the rake file or this one-pass 
>> evaluation is intended?
>>
>> Versions:
>>
>>    - Ruby ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
>>    - Capistrano   3.2.1
>>    - Rake / Rails / etc  rake, version 10.3., no rails
>>    
>> Platform:
>>
>>    - Working on.... linux
>>    - Deploying to... vagrant linux
>>    
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capistrano+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/f1b091b7-f556-4abf-aa48-1919983e2595%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to