Skip to content

Commit 68e464e

Browse files
author
Aditya Narayan
committed
handling dry run and the bom file path
1 parent 31890e4 commit 68e464e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/ArtifactoryUploader/ArtifactoryUploader.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using LCT.Services.Interface;
1313
using log4net;
1414
using System;
15+
using System.Configuration;
1516
using System.Net;
1617
using System.Net.Http;
1718
using System.Reflection;

src/ArtifactoryUploader/PackageUploadHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public async static Task<List<ComponentsToArtifactory>> GetComponentsToBeUploade
8686
Purl = item.Purl,
8787
ComponentType = GetComponentType(item),
8888
PackageType = packageType,
89-
DryRun = !appSettings.Jfrog.DryRun,
89+
DryRun = appSettings.Jfrog.DryRun,
9090
SrcRepoName = item.Properties.Find(s => s.Name == Dataconstant.Cdx_ArtifactoryRepoName)?.Value,
9191
DestRepoName = GetDestinationRepo(item, appSettings),
9292
Token = appSettings.Jfrog.Token,

src/ArtifactoryUploader/PackageUploader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static class PackageUploader
3333
public static async Task UploadPackageToArtifactory(CommonAppSettings appSettings)
3434
{
3535
//Reading the CycloneBOM data
36-
var bomFilePath = Path.Combine(appSettings.Directory.OutputFolder, appSettings.SW360.ProjectName + FileConstant.BomFileName);
36+
var bomFilePath = Path.Combine(appSettings.Directory.OutputFolder, appSettings.SW360.ProjectName + "_" + FileConstant.BomFileName);
3737
Bom m_ComponentsInBOM = PackageUploadHelper.GetComponentListFromComparisonBOM(bomFilePath);
3838

3939
DisplayAllSettings(m_ComponentsInBOM.Components, appSettings);
@@ -153,8 +153,8 @@ private static void DisplayPackageSettings(Config project)
153153
$"\tTHIRD_PARTY_REPO_NAME:\t{thirdPartyRepoName}\n" +
154154
$"\tRELEASE_REPO_NAME:\t{project.ReleaseRepo}\n" +
155155
$"\tConfig:\n" +
156-
$"\tExclude:\t\t{excludeList}\n" +
157-
$"\tInclude:\t\t{includeList}\n", null);
156+
$"\t\tExclude:\t\t{excludeList}\n" +
157+
$"\t\tInclude:\t\t{includeList}\n", null);
158158
}
159159
}
160160
}

src/ArtifactoryUploader/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ static async Task Main(string[] args)
5656
Logger.Logger.Log(null, Level.Notice, $"\n====================<<<<< Artifactory Uploader >>>>>====================", null);
5757
Logger.Logger.Log(null, Level.Notice, $"\nStart of Artifactory Uploader execution: {DateTime.Now}", null);
5858

59-
if (appSettings.Jfrog.DryRun)
59+
if (!appSettings.Jfrog.DryRun)
6060
Logger.Logger.Log(null, Level.Alert, $"Artifactory Uploader is running in release mode !!! \n", null);
6161
else
6262
Logger.Logger.Log(null, Level.Alert, $"Artifactory Uploader is running in dry-run mode, no packages will be moved \n", null);
6363

64-
var bomFilePath = Path.Combine(appSettings.Directory.OutputFolder, appSettings.SW360.ProjectName + FileConstant.BomFileName);
64+
var bomFilePath = Path.Combine(appSettings.Directory.OutputFolder, appSettings.SW360.ProjectName + "_" + FileConstant.BomFileName);
6565

6666
Logger.Logger.Log(null, Level.Info, $"Input Parameters used in Artifactory Uploader:\n\t", null);
6767
Logger.Logger.Log(null, Level.Notice, $"\tBomFilePath:\t\t {bomFilePath}\n\t" +

0 commit comments

Comments
 (0)