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
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:
56
59
57
60
``` php
@@ -66,7 +69,7 @@ class YourServiceProvider extends ServiceProvider
// The first argument will be an instance of the `Commander` class.
72
+
// The first argument will be an instance of the `Commander` class.
70
73
app('spock')->setCommands(function ($spock) {
71
74
$paths = $spock->event()->affectedPaths();
72
75
//
@@ -77,6 +80,7 @@ class YourServiceProvider extends ServiceProvider
77
80
```
78
81
79
82
## Whitelisting Environments
83
+
80
84
Spock will only run commands when it's in a whitelisted environment. By default, Spock will only run in the `production` environment.
81
85
82
86
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:
86
90
- production
87
91
- staging
88
92
```
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)
0 commit comments