You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: IV-Usage/Services.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
When creating tasks, strategies, binaries, etc., Rocketeer provides you with a variety of services you can access and use to ease your work. While all of them are describe in the public API, some are more important than others. This is a look at what Rocketeer provides you with, and gives you a little more insight on how things work under the hood.
All examples provided are from the viewpoint of a custom task. But it also applies to closure tasks, meaning if within a task class you can do `$this->foo->bar()`, within a closure you can do this:
@@ -22,19 +22,19 @@ Rocketeer::before('deploy', function (AbstractTask $task) {
22
22
});
23
23
```
24
24
25
-
[translation here]
25
+
それぞれのサービスの隣の括弧内の文字列は、それを通じてアクセス可能なハンドルです。
26
26
27
27
<!--original
28
28
The string between brackets next to each service is the handle it can be access through.
The tasks builder is one of Rocketeer's most important services, its a powerful factory that allows you to quickly get instances of binaries, tasks, strategies and so on, from within your tasks. It can build tasks from anything that is allowed: one-liners, closures, instances, or class names.
The tasks queue is the other major class of Rocketeer, it receives an array of tasks, and builds a runnable pipeline from it. Anything it receives is passed through the TasksBuilder so you can pass the same kind of tasks types (closures, strings, class names, etc.) as above.
The `run` method will return an instance of `Rocketeer\Services\Tasks\Pipeline`. The Pipeline is a class extending `Illuminate\Support\Collection` that stores instances of `Rocketeer\Services\Tasks\Job`.
Within Rocketeer, a Job is a bundled version of a queue, containing all the necessary information required to run it: what connection the queue needs to be run on, what stage, what server, etc. Imagine you have two connections, `production` and `staging`, you'll get the following pipeline:
The tasks handler registers the tasks, plugins, and events that surrounds them. It's the main task behind the `Rocketeer` facade so you should be familiar with most of its methods (before, after, listenTo, task):
The steps builder is what allows tasks to run a series of internal commands and calls and halts on the first failure, while keeping a fluent interface. Take the following series of commands inside an imaginary task:
The queue explainer is what drives Rocketeer's CLI output, its job is to explain to the user what is happening, what tasks are fired by what task or event, what is their progress, their result, how long they took to execute, etc.
By default when executing a task, the explainer will automatically display information about it from the `name` and `description` property you set on it (or passed to `Rocketeer::task`). But you can provide additional details to the explainer during the flow of your task:
@@ -213,7 +213,7 @@ if (!$this->somethingThatMayFail()) {
The explainer passes that to the Command instance's `line` method, meaning you can add foreground and background colors as described in [Symfony's documentation](http://symfony.com/doc/current/components/console/introduction.html#coloring-the-output):
@@ -223,7 +223,7 @@ The explainer passes that to the Command instance's `line` method, meaning you c
223
223
$this->explainer->line('<info>Something</info> tried and <bg=red>failed</bg=red>');
0 commit comments