관리 daemon의 실행 commit SHA를 NPC 감사 결정에 기록
This commit is contained in:
@@ -600,6 +600,8 @@ export const buildProcessDefinitions = (
|
||||
...(turnDaemonNodeOptions ? { NODE_OPTIONS: turnDaemonNodeOptions } : {}),
|
||||
POSTGRES_POOL_MAX: managedPostgresPoolMax(baseEnv, 'TURN_DAEMON_POSTGRES_POOL_MAX', 2),
|
||||
GAME_ENGINE_ROLE: 'turn-daemon',
|
||||
// 실행 worktree를 결정한 동일 프로필의 SHA를 전달한다. 부모 환경의 다른 버전은 상속하지 않는다.
|
||||
TURN_BUILD_COMMIT_SHA: profile.buildCommitSha ?? '',
|
||||
TURN_PROFILE: profile.profile,
|
||||
PROFILE: profile.profile,
|
||||
SCENARIO: profile.currentScenario ?? 'default',
|
||||
|
||||
@@ -184,6 +184,17 @@ describe('buildProcessDefinitions', () => {
|
||||
gatewayInternalApiUrl: 'http://127.0.0.1:13000',
|
||||
};
|
||||
|
||||
it('does not inherit a different profile build SHA', () => {
|
||||
const config = { ...processConfig, baseEnv: { TURN_BUILD_COMMIT_SHA: 'f'.repeat(40) } };
|
||||
expect(buildProcessDefinitions(buildProfile(), config).daemon.env.TURN_BUILD_COMMIT_SHA).toBe(
|
||||
buildProfile().buildCommitSha
|
||||
);
|
||||
expect(
|
||||
buildProcessDefinitions({ ...buildProfile(), buildCommitSha: undefined }, config).daemon.env
|
||||
.TURN_BUILD_COMMIT_SHA
|
||||
).toBe('');
|
||||
});
|
||||
|
||||
it('runs a built profile from its commit worktree', () => {
|
||||
const buildWorkspace = '/srv/sammo/worktrees/0123456789abcdef';
|
||||
const definitions = buildProcessDefinitions(buildProfile(buildWorkspace), processConfig);
|
||||
@@ -217,6 +228,7 @@ describe('buildProcessDefinitions', () => {
|
||||
expect(definitions.daemon.cwd).toBe(path.join(buildWorkspace, 'app', 'game-engine'));
|
||||
expect(definitions.daemon.script).toBe(path.join(buildWorkspace, 'app', 'game-engine', 'dist', 'index.js'));
|
||||
expect(definitions.daemon.env.POSTGRES_POOL_MAX).toBe('2');
|
||||
expect(definitions.daemon.env.TURN_BUILD_COMMIT_SHA).toBe(buildProfile().buildCommitSha);
|
||||
expect(definitions.auction).toMatchObject({
|
||||
cwd: path.join(buildWorkspace, 'app', 'game-api'),
|
||||
script: path.join(buildWorkspace, 'app', 'game-api', 'dist', 'index.js'),
|
||||
|
||||
Reference in New Issue
Block a user