Skip to content

Commit afa576f

Browse files
committed
Document queueing of commands.
1 parent a07f63b commit afa576f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

DOCUMENTATION.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## Installation
2+
23
1. Copy the `addons/Spock` directory into `site/addons`.
34
2. Whitelist the environments Spock should be run in. [Read more.](#whitelisting-environments)
45

56
## Commands
7+
68
Out of the box, Spock will perform a few git commands to stage, commit, and push any affected files.
79

810
Basically, it will do this:
@@ -52,6 +54,7 @@ git_email: [email protected]
5254

5355

5456
## Custom commands
57+
5558
The Git workflow Spock provides out of the box works fine for most people, but if you have special requirements, you may define your own set of commands. You can do this in a service provider like so:
5659

5760
``` php
@@ -66,7 +69,7 @@ class YourServiceProvider extends ServiceProvider
6669
app('spock')->setCommands(['command one', 'command two']);
6770
6871
// A closure that returns an array of commands.
69-
// The first argument will be an instance of the `Commander` class.
72+
// The first argument will be an instance of the `Commander` class.
7073
app('spock')->setCommands(function ($spock) {
7174
$paths = $spock->event()->affectedPaths();
7275
//
@@ -77,6 +80,7 @@ class YourServiceProvider extends ServiceProvider
7780
```
7881

7982
## Whitelisting Environments
83+
8084
Spock will only run commands when it's in a whitelisted environment. By default, Spock will only run in the `production` environment.
8185

8286
You can edit the environments in Spock addon settings area of the Control Panel, or add an `environments` array to `site/settings/addons/spock.yaml`, for example:
@@ -86,3 +90,12 @@ environments:
8690
- production
8791
- staging
8892
```
93+
94+
## Queueing Commands
95+
96+
Spock automatically queues commands to run in the background when you have a queue driver set. This can be helpful if you have git set to automatically push, or if you are running any commands that take time to execute, causing your users to experience wait time. To setup a queue in your statamic app:
97+
98+
1. Ensure [Redis](https://redis.io/) is installed and running on your server.
99+
2. Add `QUEUE_DRIVER=redis` to your `.env` file. [What’s an .env file?](https://docs.statamic.com/environments)
100+
3. Run `php please queue:listen`.
101+

0 commit comments

Comments
 (0)