-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to overwrite the default tasks #26
Comments
I believe this is the default behavior of Rake. If you redefine a task, you're actually adding to the behavior of the original task. For example, this Rake tutorial mentions it a bit: http://jasonseifer.com/2010/04/06/rake-tutorial There are ways to redefine Rake tasks that clears the original definition. Some of the solutions out there use the clear_actions method of Rake::Task. One thing you could do is define a task that doesn't conflict with the git:clone task, e.g. name it git:checkout or something. But if you're asking if Mina will provide a helper to easily override tasks, this is still up for debate. My gut feel is not to do this. It doesn't seem to be essential for most of the deployments out there (my guess). @rstacruz, what do you think? Btw, @jb-san, issue #10 may be interesting for you. It's about optimizing the Git clone/checkout process. |
You can simply not do a "require 'git'" :) On Jun 29, 2012, at 7:40 AM, Michael Galero
|
@rstacruz, if we are only talking about git :) It's the specific case for jb-san, but that's just an example of the issue. So if someone would like to override deploy:cleanup, but still needs most of the tasks there. |
I do realize that this is less clean, but could it not be a solution to when you do a mina init, it generates a deployment folder with, the deploy and setup and misc task defined, and the deploy.rb uses those ? that way you could have the default behavior of mina but easily override those tasks.. just a thought :) |
I would rather make the recommended path to be to implement your own tasks. For instance, you can make your own |
A new namespace Anyway, thanks for bringing up this topic @jb-san. I'm closing this issue. |
For example to override "log" task from mina/rails put this inside config/deploy.rb: Rake::Task["log"].clear
desc 'Tail log from server'
task :log do
set :execution_mode, :exec
in_path "#{fetch(:shared_path)}/log" do
command %{tail -F #{fetch(:rails_env)}.log /var/log/supervisor/puma.out.log}
end
end |
are there plans to make it possible to overwrite the default tasks ?
I know I can fork it and make the changes, but I think its better to keep the forks to a minimum..
like if I use git
I think on the initial setup, it should just clone the repository, but on subsequent deploys it should just do a git fetch origin,
when I try to overwrite the git:clone task I get
no matter what i put in the
it does echo the $PATH though..
The text was updated successfully, but these errors were encountered: