Fix build: Switch to HTTPS for private dependency using CR_PAT
Some checks failed
Build and Push Docker Image / build (push) Failing after 16s

This commit is contained in:
2026-04-24 01:42:12 +00:00
parent 299b1bbc5e
commit 76e19a82dc
4 changed files with 11 additions and 11 deletions

View File

@@ -28,5 +28,5 @@ jobs:
context: . context: .
push: true push: true
tags: gitea.ext.ben.io/${{ gitea.repository }}:latest tags: gitea.ext.ben.io/${{ gitea.repository }}:latest
secrets: | build-args: |
"ssh_key=${{ secrets.SSH_KEY }}" GITEA_TOKEN=${{ secrets.CR_PAT }}

View File

@@ -4,20 +4,21 @@ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
WORKDIR /app WORKDIR /app
# Enable SSH for git dependencies # Install git for dependency installation
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
git \ git \
ssh-client \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Add gitea.ext.ben.io to known hosts # Use Gitea PAT for private dependencies if provided
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan git.local.ben.io >> ~/.ssh/known_hosts ARG GITEA_TOKEN
RUN if [ -n "$GITEA_TOKEN" ]; then \
git config --global url."https://b3nw:${GITEA_TOKEN}@gitea.ext.ben.io/".insteadOf "https://gitea.ext.ben.io/"; \
fi
# Install dependencies # Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=secret,id=ssh_key,target=/root/.ssh/id_rsa \
uv sync --frozen --no-install-project --no-dev uv sync --frozen --no-install-project --no-dev
# Copy the rest of the application # Copy the rest of the application
@@ -25,7 +26,6 @@ COPY . /app
# Install the project # Install the project
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=secret,id=ssh_key,target=/root/.ssh/id_rsa \
uv sync --frozen --no-dev uv sync --frozen --no-dev
FROM python:3.12-slim-bookworm FROM python:3.12-slim-bookworm

View File

@@ -9,7 +9,7 @@ dependencies = [
"fastmcp>=0.4.1", "fastmcp>=0.4.1",
"starlette>=0.41.0", "starlette>=0.41.0",
"uvicorn>=0.32.0", "uvicorn>=0.32.0",
"schwab-scraper @ git+ssh://gitea@git.local.ben.io/b3nw/schwab-scraper.git", "schwab-scraper @ git+https://gitea.ext.ben.io/b3nw/schwab-scraper.git",
] ]
[build-system] [build-system]

4
uv.lock generated
View File

@@ -1697,7 +1697,7 @@ dependencies = [
requires-dist = [ requires-dist = [
{ name = "fastmcp", specifier = ">=0.4.1" }, { name = "fastmcp", specifier = ">=0.4.1" },
{ name = "mcp", specifier = ">=1.2.0" }, { name = "mcp", specifier = ">=1.2.0" },
{ name = "schwab-scraper", git = "ssh://git.local.ben.io/b3nw/schwab-scraper.git" }, { name = "schwab-scraper", git = "https://gitea.ext.ben.io/b3nw/schwab-scraper.git" },
{ name = "starlette", specifier = ">=0.41.0" }, { name = "starlette", specifier = ">=0.41.0" },
{ name = "uvicorn", specifier = ">=0.32.0" }, { name = "uvicorn", specifier = ">=0.32.0" },
] ]
@@ -1705,7 +1705,7 @@ requires-dist = [
[[package]] [[package]]
name = "schwab-scraper" name = "schwab-scraper"
version = "0.6.16" version = "0.6.16"
source = { git = "ssh://git.local.ben.io/b3nw/schwab-scraper.git#f1680aec7e26d4ec0ba71890b2f585bec0aeb13d" } source = { git = "https://gitea.ext.ben.io/b3nw/schwab-scraper.git#f1680aec7e26d4ec0ba71890b2f585bec0aeb13d" }
dependencies = [ dependencies = [
{ name = "aiohttp" }, { name = "aiohttp" },
{ name = "greenlet" }, { name = "greenlet" },