Fix dev workflow hanging and implement runtime branch detection

- Fix duplicate Dockerfile sections that were causing build hangs
- Replace complex build args with simple runtime git branch detection
- Revert CI workflows to working state (remove build args and debug code)
- Add automatic version tagging: dev branch shows "0.2.15-dev"
- Enhanced movie fallback logic for rename-first scenarios
- Improved logging to trace movie date decision process
This commit is contained in:
2025-09-10 08:54:47 -04:00
parent 6f356b1942
commit bf7fb27fdb
4 changed files with 22 additions and 47 deletions
+16 -6
View File
@@ -781,12 +781,22 @@ try:
except:
version = "0.1.0"
# Check if running in dev environment (set during Docker build)
build_type = os.environ.get('BUILD_TYPE', 'production')
image_tag = os.environ.get('IMAGE_TAG', 'latest')
if (build_type == 'dev' or 'dev' in image_tag.lower()):
version = f"{version}-dev"
# Check if running from dev branch (detect at runtime)
try:
# Try to read git branch from .git/HEAD
git_head_path = Path(__file__).parent / ".git" / "HEAD"
if git_head_path.exists():
head_content = git_head_path.read_text().strip()
if "ref: refs/heads/dev" in head_content:
version = f"{version}-dev"
elif head_content.startswith("ref: refs/heads/"):
# Extract branch name for other branches
branch = head_content.split("refs/heads/")[-1]
if branch != "main":
version = f"{version}-{branch}"
except Exception:
# If git detection fails, that's fine - use base version
pass
app = FastAPI(
title="NFOGuard",