From bb9a38f36840e10ab9828d168a74442b5eca9264 Mon Sep 17 00:00:00 2001 From: Vladimir Aleksiev Date: Thu, 5 Dec 2024 17:39:13 +0200 Subject: [PATCH] address coderabbit comments; fix logs --- Dockerfile | 14 ++++++++++++-- ingest.py | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 78b4584..1432043 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,25 @@ ARG GO_VERSION=1.21.6 ARG HUGO_VERSION=0.121.2 ARG TARGETARCH +RUN apt-get update -y \ + && apt-get upgrade -y \ + && apt-get install -y git wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + # install git, go and hugo RUN apt-get upgrade -y RUN apt-get update -y RUN apt-get install -y git wget RUN wget https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf go${GO_VERSION}.linux-${TARGETARCH}.tar.gz -RUN export PATH=$PATH:/usr/local/go/bin:/usr/local && go version +ENV PATH="/usr/local/go/bin:/usr/local:${PATH}" +RUN go version + +RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \ + && tar -C /bin -xzf hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz \ + && rm hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz -RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz && tar -C /bin -xzf hugo_extended_${HUGO_VERSION}_linux-${TARGETARCH}.tar.gz && ls -al /usr/local RUN hugo version # Install Poetry diff --git a/ingest.py b/ingest.py index be2fe15..63f266b 100644 --- a/ingest.py +++ b/ingest.py @@ -45,10 +45,10 @@ def embed_text(documents: list[Document]): async def ensure_cloned(repo_name: str, path: str): if os.path.exists(path): - logger.info(f"Repository {repo_name} already cloned.") + logger.info(f"Repository {path} already cloned.") repo = Repo.init(path) else: - logger.info(f"Closning repository: {repo_name}") + logger.info(f"Closning repository: {path}") repo = Repo.clone_from(repo_name, path, branch="main") repo.heads.main.checkout()