Skip to content

Commit

Permalink
Removed unnessasary publish artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
ragavareddychalapala committed Feb 6, 2025
1 parent 23137e4 commit 90d2aa8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/ArtifactoryUploader/PackageUploadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -997,8 +997,7 @@ public static async Task UploadingThePackages(List<ComponentsToArtifactory> comp
}

if (SetWarningCode)
{
PipelineArtifactUploader.UploadArtifacts();
{
Environment.ExitCode = 2;
Logger.Debug("Setting ExitCode to 2");
}
Expand Down
6 changes: 3 additions & 3 deletions src/LCT.Common.UTests/PipelineArtifactUploaderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public void UploadLogs_ShouldNotUpload_WhenInUnknownEnvironment()
Environment.SetEnvironmentVariable("Build_BuildId", null); // No pipeline detected

// Act
PipelineArtifactUploader.UploadLogs();
string output = consoleOutput.ToString();
PipelineArtifactUploader.UploadBom();
string output = consoleOutput.ToString().Trim();

// Assert
Assert.That(output, Is.Empty);
Assert.AreEqual("Uploading of SBOM is not supported.", output);
}

[Test]
Expand Down
6 changes: 2 additions & 4 deletions src/LCT.Common/CommonHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public static void WriteComponentsWithoutDownloadURLToKpi(List<ComparisonBomData
const string URL = "SW360 Release URL";
if (componentInfo.Count > 0 || lstReleaseNotCreated.Count > 0)
{
Logger.Logger.Log(null, Level.Alert, "Action Item required by the user:\n", null);
PipelineArtifactUploader.UploadArtifacts();
Logger.Logger.Log(null, Level.Alert, "Action Item required by the user:\n", null);
Environment.ExitCode = 2;
}

Expand Down Expand Up @@ -203,8 +202,7 @@ public static void WriteComponentsNotLinkedListInConsole(List<Components> compon
const string Version = "Version";

if (components.Count > 0)
{
PipelineArtifactUploader.UploadArtifacts();
{
Environment.ExitCode = 2;
Logger.Logger.Log(null, Level.Alert, "* Components Not linked to project :", null);
Logger.Logger.Log(null, Level.Alert, " Can be linked manually OR Check the Logs AND RE-Run", null);
Expand Down
6 changes: 3 additions & 3 deletions src/LCT.Common/PipelineArtifactUploader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public static void UploadArtifacts()
/// </summary>
public static void UploadLogs()
{
EnvironmentType envType = RuntimeEnvironment.GetEnvironment();
LogManager.Shutdown();
EnvironmentType envType = RuntimeEnvironment.GetEnvironment();
if (envType == EnvironmentType.AzurePipeline && !string.IsNullOrEmpty(Log4Net.CatoolLogPath) && File.Exists(Log4Net.CatoolLogPath))
{
{
LogManager.Shutdown();
Console.WriteLine($"##vso[artifact.upload containerfolder={LogContainerFolderName};artifactname={LogArtifactFolderName}]{Log4Net.CatoolLogPath}");
}
else if (envType == EnvironmentType.Unknown)
Expand Down

0 comments on commit 90d2aa8

Please sign in to comment.