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:
@@ -8,7 +8,7 @@ let fixture: Fixture;
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
fixture = await newFixture(['t5_kino_1']);
|
||||
fixture = await newFixture(['t5_zombie_theater_1']);
|
||||
delete process.env.KOMODO_ADDRESS;
|
||||
delete process.env.RCON_PASSWORD;
|
||||
});
|
||||
@@ -30,7 +30,7 @@ async function seedFleet(): Promise<void> {
|
||||
await seedServerRegistry();
|
||||
// Pre-create the configs directory so the config write path finds a
|
||||
// hospitable server tree.
|
||||
await mkdir(join(fixture.t5, 't5_kino_1', 'configs'), { recursive: true });
|
||||
await mkdir(join(fixture.t5, 't5_zombie_theater_1', 'configs'), { recursive: true });
|
||||
}
|
||||
|
||||
describe('config baseline + overlay flow', () => {
|
||||
@@ -65,14 +65,14 @@ describe('config baseline + overlay flow', () => {
|
||||
{ scriptId: baselineScript.id, scriptVersionId: bVer.id },
|
||||
{ scriptId: overlayScript.id, scriptVersionId: oVer.id }
|
||||
],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
|
||||
// 4. Verify: composed cfg lands at configs/dedicated_sp.cfg (in place,
|
||||
// NO -beta suffix — the game reads the exact filename).
|
||||
const cfgPath = join(fixture.t5, 't5_kino_1', 'configs', 'dedicated_sp.cfg');
|
||||
const cfgPath = join(fixture.t5, 't5_zombie_theater_1', 'configs', 'dedicated_sp.cfg');
|
||||
expect(existsSync(cfgPath)).toBe(true);
|
||||
const composed = (await readFile(cfgPath)).toString('utf8');
|
||||
expect(composed).toContain('set g_inactivity "0"');
|
||||
@@ -106,14 +106,14 @@ describe('config baseline + overlay flow', () => {
|
||||
// baseline is available.
|
||||
const { betaId } = await openBeta({
|
||||
scripts: [{ scriptId: overlayScript.id, scriptVersionId: oVer.id }],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
|
||||
const row = db()
|
||||
.prepare(`SELECT stage, error FROM beta_servers WHERE beta_id = ? AND server = ?`)
|
||||
.get(betaId, 't5_kino_1') as { stage: string; error: string | null };
|
||||
.get(betaId, 't5_zombie_theater_1') as { stage: string; error: string | null };
|
||||
expect(row.stage).toBe('failed');
|
||||
expect(row.error ?? '').toMatch(/no baseline available/);
|
||||
});
|
||||
@@ -123,7 +123,7 @@ describe('plugin kind writes to plugin destination', () => {
|
||||
it('deploys a plugin .dll directly to its target filename', async () => {
|
||||
await seedFleet();
|
||||
// Pre-create the plugins dir so the write can succeed.
|
||||
await mkdir(join(fixture.t5, 't5_kino_1', 'runtime/plutonium/plugins'), { recursive: true });
|
||||
await mkdir(join(fixture.t5, 't5_zombie_theater_1', 'runtime/plutonium/plugins'), { recursive: true });
|
||||
const { createScript, getLatestVersion } = await import('../../src/lib/server/fleet/scripts.js');
|
||||
const { openBeta } = await import('../../src/lib/server/fleet/beta.js');
|
||||
|
||||
@@ -139,12 +139,12 @@ describe('plugin kind writes to plugin destination', () => {
|
||||
|
||||
const { betaId } = await openBeta({
|
||||
scripts: [{ scriptId: script.id, scriptVersionId: v.id }],
|
||||
servers: ['t5_kino_1'],
|
||||
servers: ['t5_zombie_theater_1'],
|
||||
waitForHealth: false,
|
||||
waitForMatch: false
|
||||
});
|
||||
|
||||
const pluginPath = join(fixture.t5, 't5_kino_1', 'runtime/plutonium/plugins', 'demo.dll');
|
||||
const pluginPath = join(fixture.t5, 't5_zombie_theater_1', 'runtime/plutonium/plugins', 'demo.dll');
|
||||
expect(existsSync(pluginPath)).toBe(true);
|
||||
const bytes = await readFile(pluginPath);
|
||||
expect(bytes.equals(Buffer.from([0x00, 0x01, 0x02, 0x03]))).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user