ci: add isolated domestic frontend deployment
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import test from "node:test";
|
||||
|
||||
const workflowUrl = new URL(
|
||||
"../../../.gitea/workflows/domestic-test.yml",
|
||||
import.meta.url,
|
||||
);
|
||||
const deployScriptUrl = new URL(
|
||||
"../../server/deploy-domestic-test-archive.sh",
|
||||
import.meta.url,
|
||||
);
|
||||
|
||||
test("domestic frontend workflow is manual and registry-free", async () => {
|
||||
const workflow = await readFile(workflowUrl, "utf8");
|
||||
|
||||
assert.match(workflow, /workflow_dispatch:/);
|
||||
assert.doesNotMatch(workflow, /\bpush:/);
|
||||
assert.doesNotMatch(workflow, /REGISTRY_IMAGE/);
|
||||
assert.match(workflow, /docker save/);
|
||||
assert.match(workflow, /DOMESTIC_TEST_SSH_PRIVATE_KEY/);
|
||||
});
|
||||
|
||||
test("domestic frontend workflow pins the China test API and isolated port", async () => {
|
||||
const workflow = await readFile(workflowUrl, "utf8");
|
||||
const deployScript = await readFile(deployScriptUrl, "utf8");
|
||||
|
||||
assert.match(workflow, /https:\/\/testapi\.banlv-ai\.com/);
|
||||
assert.match(workflow, /wss:\/\/testapi\.banlv-ai\.com\/ws/);
|
||||
assert.match(workflow, /9135/);
|
||||
assert.match(deployScript, /127\.0\.0\.1:\$HOST_PORT/);
|
||||
assert.match(deployScript, /cozsweet-frontend-domestic-test/);
|
||||
});
|
||||
Reference in New Issue
Block a user