private static void AddLicenseControl(ArtifactoryConfig artifactoryConfig, Build build, BuildInfoLog log) { if (artifactoryConfig.PropertyGroup.LicenseControlCheck == null) { return; } LicenseControl licenseControl = new LicenseControl(); licenseControl.runChecks = artifactoryConfig.PropertyGroup.LicenseControlCheck.EnabledLicenseControl; licenseControl.autoDiscover = artifactoryConfig.PropertyGroup.LicenseControlCheck.AutomaticLicenseDiscovery; licenseControl.includePublishedArtifacts = artifactoryConfig.PropertyGroup.LicenseControlCheck.IncludePublishedArtifacts; licenseControl.licenseViolationsRecipients = new List <string>(); licenseControl.scopes = new List <string>(); foreach (Recipient recip in artifactoryConfig.PropertyGroup.LicenseControlCheck.LicenseViolationRecipients.Recipient) { if (validateEmail(recip)) { licenseControl.licenseViolationsRecipients.Add(recip.email); } else { log.Warning("Invalid email address, under License Control violation recipients."); } } foreach (Scope scope in artifactoryConfig.PropertyGroup.LicenseControlCheck.ScopesForLicenseAnalysis.Scope) { licenseControl.scopes.Add(scope.value); } build.licenseControl = licenseControl; }
private static void AddBlackDuck(ArtifactoryConfig artifactoryConfig, Build build, BuildInfoLog log) { if (artifactoryConfig.PropertyGroup.BlackDuckCheck == null) { return; } BlackDuckGovernance blackDuckControl = new BlackDuckGovernance(); blackDuckControl.runChecks = artifactoryConfig.PropertyGroup.BlackDuckCheck.EnabledBlackDuckCheck; blackDuckControl.appName = artifactoryConfig.PropertyGroup.BlackDuckCheck.CodeCenterApplicationName; blackDuckControl.appVersion = artifactoryConfig.PropertyGroup.BlackDuckCheck.CodeCenterApplicationVersion; blackDuckControl.reportRecipients = new List <string>(); blackDuckControl.scopes = new List <string>(); blackDuckControl.includePublishedArtifacts = artifactoryConfig.PropertyGroup.BlackDuckCheck.IncludePublishedArtifacts; blackDuckControl.autoCreateMissingComponentRequests = artifactoryConfig.PropertyGroup.BlackDuckCheck.AutoCreateMissingComponent; blackDuckControl.autoDiscardStaleComponentRequests = artifactoryConfig.PropertyGroup.BlackDuckCheck.AutoDiscardStaleComponent; foreach (Recipient recip in artifactoryConfig.PropertyGroup.BlackDuckCheck.ComplianceReportRecipients.Recipient) { if (validateEmail(recip)) { blackDuckControl.reportRecipients.Add(recip.email); } else { log.Warning("Invalid email address, under License Control violation recipients."); } } foreach (Scope scope in artifactoryConfig.PropertyGroup.BlackDuckCheck.ScopesForLicenseAnalysis.Scope) { blackDuckControl.scopes.Add(scope.value); } build.blackDuckGovernance = blackDuckControl; }
private static void AddBlackDuck(ArtifactoryConfig artifactoryConfig, Build build, BuildInfoLog log) { if (artifactoryConfig.PropertyGroup.BlackDuckCheck == null) return; BlackDuckGovernance blackDuckControl = new BlackDuckGovernance(); blackDuckControl.runChecks = artifactoryConfig.PropertyGroup.BlackDuckCheck.EnabledBlackDuckCheck; blackDuckControl.appName = artifactoryConfig.PropertyGroup.BlackDuckCheck.CodeCenterApplicationName; blackDuckControl.appVersion = artifactoryConfig.PropertyGroup.BlackDuckCheck.CodeCenterApplicationVersion; blackDuckControl.reportRecipients = new List<string>(); blackDuckControl.scopes = new List<string>(); blackDuckControl.includePublishedArtifacts = artifactoryConfig.PropertyGroup.BlackDuckCheck.IncludePublishedArtifacts; blackDuckControl.autoCreateMissingComponentRequests = artifactoryConfig.PropertyGroup.BlackDuckCheck.AutoCreateMissingComponent; blackDuckControl.autoDiscardStaleComponentRequests = artifactoryConfig.PropertyGroup.BlackDuckCheck.AutoDiscardStaleComponent; foreach (Recipient recip in artifactoryConfig.PropertyGroup.BlackDuckCheck.ComplianceReportRecipients.Recipient) { if (validateEmail(recip)) { blackDuckControl.reportRecipients.Add(recip.email); } else { log.Warning("Invalid email address, under License Control violation recipients."); } } foreach (Scope scope in artifactoryConfig.PropertyGroup.BlackDuckCheck.ScopesForLicenseAnalysis.Scope) { blackDuckControl.scopes.Add(scope.value); } build.blackDuckGovernance = blackDuckControl; }
private static void AddLicenseControl(ArtifactoryConfig artifactoryConfig, Build build, BuildInfoLog log) { if (artifactoryConfig.PropertyGroup.LicenseControlCheck == null) return; LicenseControl licenseControl = new LicenseControl(); licenseControl.runChecks = artifactoryConfig.PropertyGroup.LicenseControlCheck.EnabledLicenseControl; licenseControl.autoDiscover = artifactoryConfig.PropertyGroup.LicenseControlCheck.AutomaticLicenseDiscovery; licenseControl.includePublishedArtifacts = artifactoryConfig.PropertyGroup.LicenseControlCheck.IncludePublishedArtifacts; licenseControl.licenseViolationsRecipients = new List<string>(); licenseControl.scopes = new List<string>(); foreach (Recipient recip in artifactoryConfig.PropertyGroup.LicenseControlCheck.LicenseViolationRecipients.Recipient) { if (validateEmail(recip)) { licenseControl.licenseViolationsRecipients.Add(recip.email); } else { log.Warning("Invalid email address, under License Control violation recipients."); } } foreach (Scope scope in artifactoryConfig.PropertyGroup.LicenseControlCheck.ScopesForLicenseAnalysis.Scope) { licenseControl.scopes.Add(scope.value); } build.licenseControl = licenseControl; }