From abb163e2eda1b501af24cbd0cb133cbd8de9e0d1 Mon Sep 17 00:00:00 2001 From: varshith Date: Wed, 17 Apr 2024 10:13:27 +0200 Subject: [PATCH 1/2] logging fix while writing metadata files --- download_metadata.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/download_metadata.go b/download_metadata.go index d93dfe5..3d8a77c 100644 --- a/download_metadata.go +++ b/download_metadata.go @@ -32,13 +32,16 @@ func metadataDownloader(Metadataclient *MetadataBackend) { log.Fatalln("error:", err) } for _, obj := range page.Contents { - if err := downloadToFile(manager, LocalDirectory, Bucket, aws.ToString(obj.Key)); err != nil { - log.Fatalf("Error while getting next page from ListObjectsV2Paginator: %v", err) + err := downloadToFile(manager, LocalDirectory, Bucket, aws.ToString(obj.Key)) + if err != nil { + log.Fatal("Error while downloading metadata files from metadata bucket", err) + } else { + log.Infoln("Completed downloading metadatafiles") + } } } - log.Infoln("Completed downloading metadatafiles") } @@ -52,7 +55,7 @@ func downloadToFile(downloader *manager.Downloader, targetDirectory, bucket, key // Set up the local file fd, err := os.Create(file) if err != nil { - return err + log.Fatal("Error while writing XML files to folder", err) } defer fd.Close() // Download the file using the AWS SDK for Go From ee4cf328e7a3ec9600f2d2ee10f0232294faeb08 Mon Sep 17 00:00:00 2001 From: varshith Date: Wed, 17 Apr 2024 10:13:45 +0200 Subject: [PATCH 2/2] docker build fix --- .dockerignore | 4 ++-- Dockerfile | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 026a3b2..d913cc9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ web/content/datasets/* -dev_utils/* -nginx_proxy/* \ No newline at end of file +charts/ +dev_utils/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5fd81eb..4dc5e55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,11 @@ WORKDIR /lp_app COPY . . ENV GO111MODULE=on ENV CGO_ENABLED=0 -RUN go build -o test . +RUN go build -o app . FROM alpine:3.17 - WORKDIR /gen_app RUN apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community hugo -COPY --from=build /lp_app/test /gen_app -COPY dev_utils . - -CMD ["./test"] +COPY --from=build /lp_app/app . +COPY --from=build /lp_app/web web/ +CMD ["./app"]