refactor: make service defs the setup SSOT

This commit is contained in:
Eyejoker
2026-03-31 06:20:15 +09:00
parent 4bfd3f363f
commit 4003988ff4
4 changed files with 87 additions and 47 deletions

View File

@@ -19,6 +19,7 @@ import { getServiceDefs, type ServiceDef } from './service-defs.js';
*/
const baseServiceDef: ServiceDef = {
kind: 'primary',
description: 'EJClaw Personal Assistant',
launchdLabel: 'com.ejclaw',
logName: 'ejclaw',
@@ -126,6 +127,7 @@ describe('systemd unit generation', () => {
const unit = buildSystemdUnit(
{
...baseServiceDef,
kind: 'codex',
environmentFile: '/srv/ejclaw/.env.codex',
extraEnv: { ASSISTANT_NAME: 'codex' },
logName: 'ejclaw-codex',
@@ -184,6 +186,11 @@ describe('service definitions', () => {
'ejclaw-codex',
'ejclaw-review',
]);
expect(defs.map((def) => def.kind)).toEqual([
'primary',
'codex',
'review',
]);
});
it('generates a oneshot stack restart unit', () => {