@dooer/dooer-test-env 1.2.1 → 1.2.3
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/lib/command/service.js +6 -3
- package/lib/compose/generate.js +25 -0
- package/package.json +1 -1
package/lib/command/service.js
CHANGED
|
@@ -74,12 +74,15 @@ module.exports = {
|
|
|
74
74
|
},
|
|
75
75
|
})
|
|
76
76
|
.command({
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
// NB: the positional is `tag`, NOT `version` — a positional named `version` collides with yargs's
|
|
78
|
+
// built-in --version flag (enabled in cli.js), which made argv resolve to the boolean `true`.
|
|
79
|
+
command: 'deploy <name> <tag>',
|
|
80
|
+
describe: 'switch a service to a published registry version/tag (upgrade/downgrade)',
|
|
79
81
|
handler: (a) => {
|
|
82
|
+
if (!a.tag || typeof a.tag !== 'string') throw new Error('missing image tag, e.g. `service deploy <name> 1.2.3`')
|
|
80
83
|
const base = imageFor(a.name, rt.SERVICES_DIR)
|
|
81
84
|
if (!base) throw new Error(`unknown service ${a.name} (no manifest image)`)
|
|
82
|
-
const image = `${base.replace(/:[^:/]+$/, '')}:${a.
|
|
85
|
+
const image = `${base.replace(/:[^:/]+$/, '')}:${a.tag}`
|
|
83
86
|
// merge into the override compose file
|
|
84
87
|
let ov = { services: {} }
|
|
85
88
|
if (fs.existsSync(rt.OVERRIDE_FILE))
|
package/lib/compose/generate.js
CHANGED
|
@@ -177,6 +177,18 @@ function profilesFor(name) {
|
|
|
177
177
|
return BOOKING_PROFILE_SERVICES.includes(name) ? ['full', 'booking', 'hq'] : ['full']
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
// S3 buckets the services expect (MinIO starts empty; on staging these are OBC-provisioned). Missing ones
|
|
181
|
+
// cause `NoSuchBucket` on document upload / event-stream large-payload offload. The event-stream bucket name
|
|
182
|
+
// is stream-name-derived by the client (`${streamName}-event-stream-large-payloads`). (Jimmy 2026-09-03.)
|
|
183
|
+
const S3_BUCKETS = [
|
|
184
|
+
'file-storage-bucket', // service-file-storage (document blobs)
|
|
185
|
+
'institution-browser-bucket', // service-institution-browser
|
|
186
|
+
`${GLOBAL_OVERRIDES.DOOER_STREAM_NAME}-event-stream-large-payloads`, // @dooer/event-stream large payloads
|
|
187
|
+
's-e032-service-xrays', // service-xrays (DOOER_BUCKET_NAME, a plain manifest value)
|
|
188
|
+
'd-e023-b01-s09-dooer', // DOOER_LEGACY_STORAGE_BUCKET (read fallback)
|
|
189
|
+
'l-e025-b01-s09-dooer', // DOOER_LEGACY_STORAGE_BUCKET_FALLBACK
|
|
190
|
+
]
|
|
191
|
+
|
|
180
192
|
// The infra containers every profile needs (no `profiles:` → always started).
|
|
181
193
|
function infraServices() {
|
|
182
194
|
return {
|
|
@@ -255,6 +267,19 @@ function infraServices() {
|
|
|
255
267
|
volumes: ['minio_data:/data'],
|
|
256
268
|
restart: 'unless-stopped',
|
|
257
269
|
},
|
|
270
|
+
// One-shot: wait for MinIO, then create the buckets the services expect (idempotent). Runs on every `up`.
|
|
271
|
+
'minio-init': {
|
|
272
|
+
image: 'minio/mc:latest',
|
|
273
|
+
platform: 'linux/amd64',
|
|
274
|
+
depends_on: ['minio'],
|
|
275
|
+
entrypoint: [
|
|
276
|
+
'/bin/sh',
|
|
277
|
+
'-c',
|
|
278
|
+
`until mc alias set local http://minio:9000 ${DEV.minioUser} ${DEV.minioPassword} >/dev/null 2>&1; do sleep 1; done; ` +
|
|
279
|
+
`${S3_BUCKETS.map((b) => `mc mb --ignore-existing local/${b}`).join('; ')}; echo minio-init done`,
|
|
280
|
+
],
|
|
281
|
+
restart: 'no',
|
|
282
|
+
},
|
|
258
283
|
// Mutable name→endpoint registry that speaks the Consul health API. Build context is an ABSOLUTE
|
|
259
284
|
// path to the repo's discovery-router, so it resolves no matter where the compose file is written
|
|
260
285
|
// (it lives in ~/.dooer-test-env, not the repo).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dooer/dooer-test-env",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Run the whole Dooer backend locally (staging DB minus customers), copy/purge customers between environments, and shred — one CLI.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": "Dooer/cli-dooer-test-env",
|