diff --git a/.dockerignore b/.dockerignore index d913cc9..a6a9bb6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,3 @@ web/content/datasets/* charts/ -dev_utils/ \ No newline at end of file +dev_utils/* \ No newline at end of file diff --git a/download_metadata.go b/download_metadata.go index 374b848..466e3ca 100644 --- a/download_metadata.go +++ b/download_metadata.go @@ -35,11 +35,9 @@ func metadataDownloader(Metadataclient *MetadataBackend) { 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 metadata files") } diff --git a/markdown_writer.go b/markdown_writer.go index b955cb2..a309937 100644 --- a/markdown_writer.go +++ b/markdown_writer.go @@ -35,17 +35,17 @@ func markDownCreator() { // Read XML file name xmlFileName := filepath.Base(xmlFilePath) - fmt.Println(xmlFilePath) + log.Debug(xmlFilePath) xmlContent, err := readXMLFile(xmlFilePath) if err != nil { - fmt.Println(err) + log.Fatalf("Error reading the XML file %V", err) } headerValue, err := getHeaderValueFromXMLContent(xmlContent) if err != nil { - fmt.Println(err) + log.Fatal("Error while getting header value from XML file", err) } - fmt.Printf("Header value: %s\n", headerValue) + log.Debugln("Header value: %V", headerValue) // Remove file extension fileNameWithoutExt := strings.TrimSuffix(xmlFileName, filepath.Ext(xmlFileName)) @@ -76,7 +76,7 @@ Filename of the associated XML file: %s return nil } - log.Infoln("Markdown file %S created successfully!\n", mdFileName) + log.Debug("Markdown file %S created successfully!\n", mdFileName) return nil }) @@ -84,4 +84,5 @@ Filename of the associated XML file: %s if err != nil { log.Fatal("Error walking through directory:", err) } + } diff --git a/static_files_uploader.go b/static_files_uploader.go index e84c324..60c2e16 100644 --- a/static_files_uploader.go +++ b/static_files_uploader.go @@ -14,7 +14,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3" ) -func test(DeploymenClient *DeploymentBackend) { +func staticSiteUploader(DeploymenClient *DeploymentBackend) { var ( localPath = "web/public/" bucket = DeploymenClient.Bucket @@ -71,8 +71,10 @@ func test(DeploymenClient *DeploymentBackend) { if err != nil { log.Fatalln("Failed to upload", path, err) } - log.Infoln("Uploaded", path, result.Location) + log.Debugln("Uploaded", path, result.Location) } + log.Infoln("Successfully uploaded built static site to the bucket") + } type fileWalk chan string