Closed marcovtwout closed 8 months ago
Tasks defined anywhere can be called anywhere, be it through the facade, or the custom array, and then called inside a task, in an event, etc. Everything is merged together.
If I define a task like this:
Rocketeer::task('foo_bar', 'echo "foo"')
How can I call it in hooks?
Just "foo_bar" will work
It seems for tasks with an underscore, Rocketeer tries to execute it as a bash command. Output from --pretend:
staging/0 |-- Closure (foo_bar) fired by deploy.after [~0.02s]
$ cd /data/www/test/releases/20141028160250
$ foo_bar
[user@host] (staging) bash: foo_bar: command not found
Hm, try foo-bar
?
This works. Can you clear up this inconsistency? :)
Task names get sluggified, if you name your task "Foo Bar" internally it'll be referenced as "foo-bar". Just forgot that _ got replaced too. At least I think so. Need to add some tests for this to double check and edit the docs if that's indeed the case.
The examples don't explain yet how to run tasks that you defined through a facade, although I found out it is possible. Could you add an example like this?