trying to add gitea

This commit is contained in:
2025-09-22 10:12:07 -04:00
parent 95273be0b0
commit 7de99ef945
4 changed files with 9 additions and 5 deletions
+1
View File
@@ -97,6 +97,7 @@ jobs:
docker build \ docker build \
$CACHE_ARGS \ $CACHE_ARGS \
--build-arg GIT_BRANCH=dev \ --build-arg GIT_BRANCH=dev \
--build-arg BUILD_SOURCE=gitea \
--tag nfoguard:dev \ --tag nfoguard:dev \
--tag nfoguard:dev-${{ github.sha }} \ --tag nfoguard:dev-${{ github.sha }} \
--tag "$CACHE_IMAGE" \ --tag "$CACHE_IMAGE" \
+1
View File
@@ -100,6 +100,7 @@ jobs:
docker build \ docker build \
$CACHE_ARGS \ $CACHE_ARGS \
--build-arg GIT_BRANCH=main \ --build-arg GIT_BRANCH=main \
--build-arg BUILD_SOURCE=gitea \
--tag nfoguard:latest \ --tag nfoguard:latest \
--tag nfoguard:${{ github.sha }} \ --tag nfoguard:${{ github.sha }} \
--tag "$CACHE_IMAGE" \ --tag "$CACHE_IMAGE" \
+3 -2
View File
@@ -1,14 +1,15 @@
FROM python:3.11-slim FROM python:3.11-slim
# Build argument for git branch # Build argument for git branch and build source
ARG GIT_BRANCH=main ARG GIT_BRANCH=main
ARG BUILD_SOURCE=
# Set environment variables # Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=utf-8 \ PYTHONIOENCODING=utf-8 \
GIT_BRANCH=${GIT_BRANCH} \ GIT_BRANCH=${GIT_BRANCH} \
GITEA_BUILD=true BUILD_SOURCE=${BUILD_SOURCE}
# Install system dependencies including PostgreSQL client libraries # Install system dependencies including PostgreSQL client libraries
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
+4 -3
View File
@@ -1397,9 +1397,10 @@ except Exception:
# If git detection fails, that's fine - use base version # If git detection fails, that's fine - use base version
pass pass
# Check for Gitea build environment variable # Check for build source (only add -gitea for local Gitea builds)
if os.environ.get("GITEA_BUILD") == "true": build_source = os.environ.get("BUILD_SOURCE", "")
if "-" not in version: # Don't double-add suffixes if build_source == "gitea":
if "gitea" not in version: # Don't double-add gitea suffix
version = f"{version}-gitea" version = f"{version}-gitea"
app = FastAPI( app = FastAPI(