feat: dynamic version from VERSION file (v1.3.57)

- Created VERSION file with current version
- Health endpoints now read version from VERSION file instead of hardcoded
- Fixes issue where health check showed wrong version
- main.py /health and /api/v1/system/health now show correct version
This commit is contained in:
Christian 2025-12-23 15:32:26 +01:00
parent 0833f149e1
commit c254e7cb76
3 changed files with 12 additions and 2 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.3.57

View File

@ -6,6 +6,15 @@ Health checks and system information
from fastapi import APIRouter
from app.core.config import settings
from app.core.database import execute_query
from pathlib import Path
# Read version from VERSION file
def get_version():
try:
version_file = Path(__file__).parent.parent.parent.parent / "VERSION"
return version_file.read_text().strip()
except:
return "unknown"
router = APIRouter()
@ -23,7 +32,7 @@ async def health_check():
return {
"status": "healthy",
"service": "BMC Hub",
"version": "1.0.0",
"version": get_version(),
"database": db_status,
"config": {
"environment": "production" if not settings.ECONOMIC_DRY_RUN else "development",

View File

@ -131,7 +131,7 @@ async def health_check():
return {
"status": "healthy",
"service": "BMC Hub",
"version": "1.0.0"
"version": get_version()
}
if __name__ == "__main__":