fix: version Docker — générer VERSION file depuis .git/HEAD au build
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 17s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 17s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
- Dockerfile: COPY .git/HEAD + .git/refs/ → génère backend/VERSION avec hash - version.py: fallback lit backend/VERSION (à côté du module, pas racine repo) - Format: 1.8.0-0-g<8-char-hash> ou 1.8.0-dev si indisponible
This commit is contained in:
+2
-2
@@ -37,8 +37,8 @@ def get_version() -> str:
|
||||
except (FileNotFoundError, subprocess.TimeoutExpired, OSError):
|
||||
pass
|
||||
|
||||
# Fallback: try reading from a VERSION file
|
||||
version_file = _ROOT / "VERSION"
|
||||
# Fallback: try reading from a VERSION file next to this module
|
||||
version_file = Path(__file__).parent / "VERSION"
|
||||
if version_file.exists():
|
||||
return version_file.read_text().strip()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user