Added git commit id to build process
This commit is contained in:
1 parent
bd2b0b601e
commit
22d7940e87
4 files changed
+11
-2
No files matched your search
@@ -35,7 +35,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
run: |
|
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 }}
|
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
||||||
|
|
||||||
- name: Clone ops-deployment repo
|
- name: Clone ops-deployment repo
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
run: |
|
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 }}
|
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
||||||
|
|
||||||
- name: Clone ops-deployment repo
|
- name: Clone ops-deployment repo
|
||||||
|
|||||||
@@ -11,5 +11,9 @@ FROM nvcr.io/nvidia/distroless/python:3.12-v4.1.6
|
|||||||
COPY --from=builder /install /usr/local
|
COPY --from=builder /install /usr/local
|
||||||
COPY --from=builder /app /app
|
COPY --from=builder /app /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
ARG COMMIT_ID=unknown
|
||||||
|
ENV COMMIT_ID=$COMMIT_ID
|
||||||
|
|
||||||
ENTRYPOINT ["python", "main.py"]
|
ENTRYPOINT ["python", "main.py"]
|
||||||
|
|
||||||
@@ -201,6 +201,7 @@ def get_chapters(request: Request, db = Depends(get_db)):
|
|||||||
|
|
||||||
async def start_servers():
|
async def start_servers():
|
||||||
logger.info("[Server] Starting main API (port 5000) and metrics server (port 9000)...")
|
logger.info("[Server] Starting main API (port 5000) and metrics server (port 9000)...")
|
||||||
|
logger.info(f"[Server] Build commit id={os.getenv("COMMIT_ID","unknown")}")
|
||||||
config_main = uvicorn.Config(api, host="0.0.0.0", port=5000, log_level=LOG_LEVEL.lower(), log_config=None)
|
config_main = uvicorn.Config(api, host="0.0.0.0", port=5000, log_level=LOG_LEVEL.lower(), log_config=None)
|
||||||
config_metrics = uvicorn.Config(metrics_api, host="0.0.0.0", port=9000, log_level=LOG_LEVEL.lower(), log_config=None)
|
config_metrics = uvicorn.Config(metrics_api, host="0.0.0.0", port=9000, log_level=LOG_LEVEL.lower(), log_config=None)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user