Add deploy + destroy server flow; migrate to t5_<mode>_<slug>_<n> naming
Full server lifecycle management from Electric Cherry: pick game/mode/map/pluto key in the Fleet page, EC provisions the deployment via Komodo, allocates a port in 28960-28980, creates the 0o777 host dir, and starts the container. Destroy button tears everything down (Komodo Destroy+Delete, rm -rf host dir, transactional DB cleanup) and surfaces any partial-failure warnings inline. Same phase cuts over to the new naming scheme (t5_zombie_cosmodrome_1 etc.). Komodo entity names now match EC server names 1:1 (no more _/- transform), and the map catalog carries friendly/slug/canonical for each of the 11 t5 zombie maps. Server rows gain game_mode, map_slug, host_dir, config_file, game_id, image, created_by, and destroyed_at columns for provisioning + audit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ let fixture: Fixture;
|
||||
// fixtures and hits a released sqlite handle.
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
fixture = await newFixture(['t5_kino_1', 't5_ascension_1']);
|
||||
fixture = await newFixture(['t5_zombie_theater_1', 't5_zombie_cosmodrome_1']);
|
||||
delete process.env.KOMODO_ADDRESS;
|
||||
delete process.env.RCON_PASSWORD;
|
||||
});
|
||||
@@ -55,7 +55,7 @@ describe('promote creates a deployment', () => {
|
||||
// other server (via scope) and mark it pending for restart.
|
||||
const { betaId } = await openBeta({
|
||||
scripts: [{ scriptId: script.id, scriptVersionId: version.id }],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
@@ -68,7 +68,7 @@ describe('promote creates a deployment', () => {
|
||||
const result = await promoteBeta(betaId);
|
||||
|
||||
expect(result.deploymentId).toMatch(/^dep-.*-promote-\d+$/);
|
||||
expect(new Set(result.landed)).toEqual(new Set(['t5_kino_1', 't5_ascension_1']));
|
||||
expect(new Set(result.landed)).toEqual(new Set(['t5_zombie_theater_1', 't5_zombie_cosmodrome_1']));
|
||||
expect(result.scriptIds).toEqual([script.id]);
|
||||
|
||||
// Deployment row is action='promote'. The multi-script schema stores
|
||||
@@ -99,8 +99,8 @@ describe('promote creates a deployment', () => {
|
||||
.prepare(`SELECT * FROM deployment_servers WHERE deployment_id = ? ORDER BY server`)
|
||||
.all(result.deploymentId) as any[];
|
||||
const byName = Object.fromEntries(servers.map((s) => [s.server, s.restart_state]));
|
||||
expect(byName['t5_kino_1']).toBe('done');
|
||||
expect(byName['t5_ascension_1']).toBe('pending');
|
||||
expect(byName['t5_zombie_theater_1']).toBe('done');
|
||||
expect(byName['t5_zombie_cosmodrome_1']).toBe('pending');
|
||||
|
||||
// Script's current_version_id and beta state land.
|
||||
const after = getScript(script.id)!;
|
||||
@@ -128,7 +128,7 @@ describe('rollback beta on ready-promote marks version test-failed', () => {
|
||||
|
||||
const { betaId } = await openBeta({
|
||||
scripts: [{ scriptId: script.id, scriptVersionId: v.id }],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
@@ -165,7 +165,7 @@ describe('rollback promote deployment', () => {
|
||||
|
||||
const { betaId } = await openBeta({
|
||||
scripts: [{ scriptId: script.id, scriptVersionId: v.id }],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
@@ -179,7 +179,7 @@ describe('rollback promote deployment', () => {
|
||||
|
||||
const result = await rollbackPromoteDeployment(promote.deploymentId);
|
||||
expect(result.deploymentId).toMatch(/^dep-.*-rollback-/);
|
||||
expect(new Set(result.affectedServers)).toEqual(new Set(['t5_kino_1', 't5_ascension_1']));
|
||||
expect(new Set(result.affectedServers)).toEqual(new Set(['t5_zombie_theater_1', 't5_zombie_cosmodrome_1']));
|
||||
expect(result.scriptIds).toEqual([script.id]);
|
||||
|
||||
// Script's current_version_id reverted (was null before the promote).
|
||||
@@ -241,7 +241,7 @@ describe('multi-script beta', () => {
|
||||
{ scriptId: a.script.id, scriptVersionId: va.id },
|
||||
{ scriptId: b.script.id, scriptVersionId: vb.id }
|
||||
],
|
||||
servers: ['t5_kino_1', 't5_ascension_1'],
|
||||
servers: ['t5_zombie_theater_1', 't5_zombie_cosmodrome_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
@@ -252,7 +252,7 @@ describe('multi-script beta', () => {
|
||||
expect(new Set(bundle.map((r) => r.script_id))).toEqual(new Set([a.script.id, b.script.id]));
|
||||
|
||||
// Both target rel paths are held on both servers.
|
||||
const held1 = heldByBeta('t5_kino_1');
|
||||
const held1 = heldByBeta('t5_zombie_theater_1');
|
||||
expect(held1.get('hud.gsc')).toBe(betaId);
|
||||
expect(held1.get('flag.gsc')).toBe(betaId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user