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