feat: prepare deep search production runtime
Memind CI / Test, build, and release guards (pull_request) Successful in 4m4s
Memind CI / Test, build, and release guards (pull_request) Successful in 4m4s
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const read = (relativePath) => readFileSync(path.join(root, relativePath), 'utf8');
|
||||
|
||||
test('Deep Search production runtime is isolated from Portal releases', () => {
|
||||
const builder = read('scripts/build-deep-search-runtime.mjs');
|
||||
assert.match(builder, /deep-search-server\.mjs/);
|
||||
assert.match(builder, /\.runtime', 'deep-search/);
|
||||
|
||||
const runner = read('scripts/run-deep-search-prod.sh');
|
||||
assert.match(runner, /shared\/\.env/);
|
||||
assert.match(runner, /data\/research\.sqlite/);
|
||||
assert.match(runner, /127\.0\.0\.1:20080\/search/);
|
||||
|
||||
const installer = read('scripts/install-deep-search-runtime-prod.sh');
|
||||
assert.match(installer, /cn\.tkmind\.memind-deep-search/);
|
||||
assert.match(installer, /chmod 600/);
|
||||
assert.match(installer, /openssl rand -hex 32/);
|
||||
|
||||
const release = read('scripts/release-deep-search-runtime-prod.sh');
|
||||
assert.match(release, /branch.*main/);
|
||||
assert.match(release, /CONFIRMED_CI_SHA/);
|
||||
assert.match(release, /shasum -a 256/);
|
||||
assert.match(release, /rollback/);
|
||||
assert.doesNotMatch(release, /release-portal-runtime-prod/);
|
||||
});
|
||||
Reference in New Issue
Block a user