Added git commit id to build process

This commit is contained in:
florian committed 2026-10-19 11:16:12 +02:00
1 parent ba24478aa5
commit 6895d40f34
4 files changed
+12 -2

No files matched your search

+3 -1
View File
@@ -35,7 +35,9 @@ jobs:
- name: Build and Push Docker Image
run: |
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
docker build \
--build-arg COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) \
-t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
- name: Clone ops-deployment repo
+3 -1
View File
@@ -35,7 +35,9 @@ jobs:
- name: Build and Push Docker Image
run: |
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
docker build \
--build-arg COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) \
-t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
- name: Clone ops-deployment repo
+4
View File
@@ -11,5 +11,9 @@ FROM nvcr.io/nvidia/distroless/python:3.12-v4.1.6
COPY --from=builder /install /usr/local
COPY --from=builder /app /app
WORKDIR /app
ARG COMMIT_ID=unknown
ENV COMMIT_ID=$COMMIT_ID
ENTRYPOINT ["python", "main.py"]
+2
View File
@@ -1,5 +1,6 @@
import asyncio
from contextlib import asynccontextmanager
import os
import uvicorn
from fastapi import Depends, FastAPI, HTTPException, Request, Response
@@ -151,6 +152,7 @@ def handle_pihole(
async def start_servers():
logger.info("[Server] Starting main and metrics servers")
logger.info(f"[Server] Build commit id={os.getenv("COMMIT_ID","unknown")}")
config_main = uvicorn.Config("main:api", host="0.0.0.0", port=5000, log_level=LOG_LEVEL.lower(), log_config=None)
config_metrics = uvicorn.Config("metrics_server:metrics_api", host="0.0.0.0", port=9000, log_level=LOG_LEVEL.lower(), log_config=None)