I'd like to stop some processes before running the deploy:migrate task. I know that I can redefine the deploy:migrate task by copying the existing code and adding the stop/start steps at the beginning and end of the task.
I'm wondering if there is a way to avoid copying the code from the default deploy:migrate task in my version of the task. Is there a way to refer to the existing deploy:migrate task when defining a new task of the same name?
Rather than redefining deploy:migrate
, you should define a before or after hook for it. First, create a new task that does the stuff you need to do:
task :custom_name do
# whatever you need to do
end
And then set this new task to be run before or after the deploy:migrate
task by doing one of the following:
before "deploy:migrate", :custom_name
after "deploy:migrate", :custom_name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With