config and plugin
This commit is contained in:
@@ -17,6 +17,13 @@ function num(name: string, fallback: number): number {
|
||||
export const config = {
|
||||
serversRoot: req('SERVERS_ROOT', '/root/zombies/t5'),
|
||||
relDest: req('REL_DEST', 'runtime/plutonium/storage/t5/raw/scripts/sp'),
|
||||
// Per-kind destination sub-paths under each server's directory. `relDest`
|
||||
// above stays as the script fallback so existing deploys keep working.
|
||||
relDestScript: env.REL_DEST_SCRIPT ?? env.REL_DEST ?? 'runtime/plutonium/storage/t5/raw/scripts/sp',
|
||||
relDestConfig: env.REL_DEST_CONFIG ?? 'configs',
|
||||
relDestPlugin: env.REL_DEST_PLUGIN ?? 'runtime/plutonium/plugins',
|
||||
// Filename the baseline+overlays compose into. Same for every scope today.
|
||||
configTargetFile: env.CONFIG_TARGET_FILE ?? 'dedicated_sp.cfg',
|
||||
// Where on-disk copies of active beta files live for operator visibility.
|
||||
// Cleared per-beta on promote/rollback.
|
||||
betaArchiveDir: req('BETA_ARCHIVE_DIR', '/root/zombies/beta-archive'),
|
||||
@@ -48,5 +55,21 @@ export function rconConfigured(): boolean {
|
||||
return !!config.rcon.password;
|
||||
}
|
||||
|
||||
export const destOf = (server: string) => `${config.serversRoot}/${server}/${config.relDest}`;
|
||||
export type ArtifactKind = 'script' | 'config' | 'plugin' | 'baseline';
|
||||
|
||||
export function relDestForKind(kind: ArtifactKind): string {
|
||||
switch (kind) {
|
||||
case 'script': return config.relDestScript;
|
||||
case 'config': return config.relDestConfig;
|
||||
case 'baseline': return config.relDestConfig;
|
||||
case 'plugin': return config.relDestPlugin;
|
||||
}
|
||||
}
|
||||
|
||||
export const destOfKind = (server: string, kind: ArtifactKind) =>
|
||||
`${config.serversRoot}/${server}/${relDestForKind(kind)}`;
|
||||
|
||||
// Back-compat: existing call sites written before the multi-kind refactor
|
||||
// resolve to the script destination.
|
||||
export const destOf = (server: string) => destOfKind(server, 'script');
|
||||
export const betaArchiveOf = (betaId: number) => `${config.betaArchiveDir}/beta-${betaId}`;
|
||||
|
||||
Reference in New Issue
Block a user