Add runner ci (test)

This commit is contained in:
2026-03-10 23:56:53 +01:00
parent c3fbd7d4fe
commit f5bf18b739
21 changed files with 1372 additions and 39 deletions

View File

@@ -1,24 +1,15 @@
import { Router } from 'express';
import fs from 'fs';
import path from 'path';
import { getAllPublicServers } from '../cqrs';
import { getReleaseManifestUrl } from '../config/variables';
import { SERVER_BUILD_VERSION } from '../generated/build-version';
import { connectedUsers } from '../websocket/state';
const router = Router();
function getServerProjectVersion(): string {
try {
const packageJsonPath = path.join(process.cwd(), 'package.json');
const rawContents = fs.readFileSync(packageJsonPath, 'utf8');
const parsed = JSON.parse(rawContents) as { version?: unknown };
return typeof parsed.version === 'string' && parsed.version.trim().length > 0
? parsed.version.trim()
: '0.0.0';
} catch {
return '0.0.0';
}
return typeof process.env.METOYOU_SERVER_VERSION === 'string' && process.env.METOYOU_SERVER_VERSION.trim().length > 0
? process.env.METOYOU_SERVER_VERSION.trim()
: SERVER_BUILD_VERSION;
}
router.get('/health', async (_req, res) => {