laracrew 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -2
- package/README.md +52 -14
- package/dist/index.js +154 -35
- package/dist/index.js.map +1 -1
- package/examples/README.md +7 -1
- package/examples/django-celery/stack.yaml +5 -0
- package/examples/node-api-and-web/stack.yaml +5 -2
- package/examples/polyglot-microservices/stack.yaml +4 -2
- package/package.json +2 -2
package/examples/README.md
CHANGED
|
@@ -76,4 +76,10 @@ here, it stops when the rest of the stack stops.
|
|
|
76
76
|
mis-split on a path containing spaces the way a shell string can.
|
|
77
77
|
|
|
78
78
|
**A gate with nothing to start is fine.** An `external: true` service is just a health check, so
|
|
79
|
-
it can stand in as a named wait step — see `kafka-wait` in the microservices example.
|
|
79
|
+
it can stand in as a named wait step — see `kafka-wait` in the microservices example. `laracrew
|
|
80
|
+
doctor` probes those gates before boot, so declaring your Postgres and Redis this way is also how
|
|
81
|
+
you get them checked.
|
|
82
|
+
|
|
83
|
+
**The Laravel checks only apply to Laravel.** `doctor` works out which projects actually run PHP
|
|
84
|
+
and which actually talk to Redis, from the commands they declare and the `.env` they read. A
|
|
85
|
+
Django or Node stack gets the port and dependency checks and none of the PHP ones.
|
|
@@ -61,6 +61,11 @@ services:
|
|
|
61
61
|
env:
|
|
62
62
|
PYTHONUNBUFFERED: "1"
|
|
63
63
|
ready: { logMatch: "ready\\.$|celery@.* ready", timeoutMs: 30000 }
|
|
64
|
+
# The Celery equivalent of `artisan queue:restart`: ask the worker to finish the task it
|
|
65
|
+
# holds and exit by itself. Only if it is still there after 25s does laracrew signal it.
|
|
66
|
+
stop:
|
|
67
|
+
exec: [".venv/bin/celery", "-A", "bookstore", "control", "shutdown"]
|
|
68
|
+
graceMs: 25000
|
|
64
69
|
|
|
65
70
|
- name: celery:beat
|
|
66
71
|
project: app
|
|
@@ -64,8 +64,11 @@ services:
|
|
|
64
64
|
cmd: ["npm", "run", "worker"] # BullMQ / Bee-Queue consumer
|
|
65
65
|
groups: [backend, workers]
|
|
66
66
|
needs: [redis, types:build]
|
|
67
|
-
#
|
|
68
|
-
|
|
67
|
+
# Same deal as a Laravel queue worker: ask it to drain, give it 10s, then escalate.
|
|
68
|
+
# The script closes the BullMQ worker and exits once the current job is acked.
|
|
69
|
+
stop:
|
|
70
|
+
exec: ["npm", "run", "worker:drain"]
|
|
71
|
+
graceMs: 10000
|
|
69
72
|
|
|
70
73
|
- name: web
|
|
71
74
|
project: web
|
|
@@ -44,8 +44,10 @@ services:
|
|
|
44
44
|
groups: [infra]
|
|
45
45
|
# Ready when every port we depend on is actually accepting connections.
|
|
46
46
|
ready: { tcp: "127.0.0.1:5432", timeoutMs: 120000, intervalMs: 1000 }
|
|
47
|
-
# Compose
|
|
48
|
-
stop:
|
|
47
|
+
# Let Compose stop its own containers the way it wants to, before anything is killed.
|
|
48
|
+
stop:
|
|
49
|
+
exec: ["docker", "compose", "stop"]
|
|
50
|
+
graceMs: 30000
|
|
49
51
|
|
|
50
52
|
- name: kafka-wait
|
|
51
53
|
external: true # nothing to start; this row exists purely as a gate
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laracrew",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Boot and supervise all the long-running processes of your
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Boot and supervise all the long-running processes of your projects with one command. Laravel-aware, works with anything.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"laravel",
|
|
7
7
|
"cli",
|