If you are following the standard cap pattern and setting your scm to git then 
"deploy:update_code" is where capistrano does it's clone business. 

You can simply stack after hooks to trigger your own tasks

Ie:

after "deploy:update_code", :task1, :task2

Etc

For pulling down a different repo in an arbitrary task there is an example of 
that in the utilities helper of cap-recipes. git_clone_or_pull   
https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/utilities.rb

Also im assuming you using 'local destination' because you aren't aware of the 
actual capistrano variables;

It's generally safest to use latest_release unless you know what the precise 
differences are. 

Many aha moments are contained within this single file:

https://github.com/capistrano/capistrano/blob/master/lib/capistrano/recipes/deploy.rb

On Nov 2, 2011, at 6:39 AM, hiroysato <[email protected]> wrote:

> Dear members.
> 
> I'm newbie Capistrano.
> 
> I would like to do like the following.
> Could you tell me how to add my custom task (number 2)??
> 
> * I would like to do like the following.
> 
>  1, fetch main project from [email protected]:main_project.git
>   to local machine #{local_destination}
>  2, copy additional files into #{local_destionation}/config/
> my_config_files.txt
>    from [email protected]:configirations.git
>  3, copy it to application server
> 
> * my current deploy.rb
> 
>  set :application, "myapp"
>  set :repository,  "[email protected]:main_project.git"
>  set :deploy_via, :copy
> 
>  set :scm, :git
>  role :web, "webserver"
>  role :app, "appserver"
>  role :db,  "dbserver", :primary => true
> 
>  set :deploy_to, "/tmp/hogehoge"
> 
> * my custom task example
> 
>  I would like to hook after fetch main project. like this
> 
>  after "fetch git clone main_project.git" do
>   Dir.chdir #{local_destination}
> 
>   execute my custom task.
> 
>  end
> 
> Sincerely.
> 
> --
> Hiroyuki Sato.
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to