Capistrano and MongoDB
I'm new to Capistrano and unfortunately there isn't enough documentation on the web regarding Rails deployment. From what I understand, in order to use a recipe开发者_如何学Python that's in another file, you have to include it. For example, if I want to use this recipe https://gist.github.com/710730 I'll have to add it to the top of the deploy.rb file as
require 'sync'
Is this correct so far? And if yes, how do I call the tasks since cap -T doesn't list them. I am sorry for asking something that simple, but I can't find proper documentation to follow. Thank you.
Create a folder to hold your recipe files and then tell cap to load the tasks in it in your Capfile (assuming you decided to have your custom tasks in config/deploy/recipes):
Dir['config/deploy/recipes/*.rb'].each { |plugin| load(plugin) }
You don't need to require it like a normal ruby file.
When using capistrano to load your tasks like this, there's no need to define your tasks and namespaces with Capistrano::Configuration.instance.load do
(https://gist.github.com/747564)
精彩评论