protected override void InternalBuild() { var x64Components = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); var x86Components = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x86", RepoRootDirectory, HomeRootDirectory); x64Components.ValidateComponents(); x86Components.ValidateComponents(); FileHelpers.CopyAll($@"{PackageDirectory}\Installer", FilesToZipFolderName); var replacements = new Dictionary <string, string>() { { "AGENT_VERSION_STRING", x64Components.Version } }; FileHelpers.ReplaceTextInFile($@"{FilesToZipFolderName}\install.ps1", replacements); var agentInfo = new AgentInfo { InstallType = "ScriptableFramework" }; agentInfo.WriteToDisk(FilesToZipFolderName); CreateNugetPackage(x64Components, x86Components, $@"{PackageDirectory}\NewRelic.Net.Agent.x64.nuspec"); CreateNugetPackage(x86Components, x86Components, $@"{PackageDirectory}\NewRelic.Net.Agent.nuspec"); var zipFilePath = $@"{OutputDirectory}\NewRelic.Agent.Installer.{x64Components.Version}.zip"; Directory.CreateDirectory(OutputDirectory); System.IO.Compression.ZipFile.CreateFromDirectory(FilesToZipFolderName, zipFilePath); File.WriteAllText($@"{OutputDirectory}\checksum.sha256", FileHelpers.GetSha256Checksum(zipFilePath)); }
protected override void InternalBuild() { var agentComponents = AgentComponents.GetAgentComponents(AgentType, Configuration, Platform, RepoRootDirectory, HomeRootDirectory); agentComponents.ValidateComponents(); agentComponents.CopyComponents(StagingDirectory); var agentInfo = new AgentInfo { InstallType = $"ZipWin{Platform}{AgentType.ToString()}" }; agentInfo.WriteToDisk(StagingDirectory); var zipFilePath = AgentType == AgentType.Framework ? $@"{OutputDirectory}\newrelic-framework-agent_{agentComponents.Version}_{Platform}.zip" : $@"{OutputDirectory}\newrelic-netcore20-agent-win_{agentComponents.Version}_{Platform}.zip"; Directory.CreateDirectory(OutputDirectory); System.IO.Compression.ZipFile.CreateFromDirectory(StagingDirectory, zipFilePath); File.WriteAllText($@"{OutputDirectory}\checksum.sha256", FileHelpers.GetSha256Checksum(zipFilePath)); // For now, the DotNet-Core20-Agent-DeployToS3 job expects core agent artifacts to be in the following directory // At some point we should change the job to pull from the new location under the Build\BuildArtifacts directory if (AgentType == AgentType.Core) { FileHelpers.CopyFile(zipFilePath, $@"{RepoRootDirectory}\src\_build\CoreArtifacts"); } Console.WriteLine($"Successfully created artifact for {nameof(ZipArchive)}."); }
public DownloadSiteArtifact(string configuration) : base("DownloadSite") { OutputDirectory = $@"{RepoRootDirectory}\build\BuildArtifacts\{Name}"; ShaDirectory = OutputDirectory + @"\SHA256"; var agentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, configuration, "x64", RepoRootDirectory, HomeRootDirectory); Version = agentComponents.Version; }
protected override void InternalBuild() { var rootDirectory = $@"{StagingDirectory}\content\newrelic"; var frameworkAgentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); var frameworkAgentX86Components = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x86", RepoRootDirectory, HomeRootDirectory); var coreAgentComponents = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); var coreAgentX86Components = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, "x86", RepoRootDirectory, HomeRootDirectory); frameworkAgentComponents.ValidateComponents(); frameworkAgentX86Components.ValidateComponents(); coreAgentComponents.ValidateComponents(); coreAgentX86Components.ValidateComponents(); var package = new NugetPackage(StagingDirectory, OutputDirectory); frameworkAgentComponents.CopyComponents($@"{package.ContentDirectory}\newrelic"); FileHelpers.CopyFile(frameworkAgentX86Components.WindowsProfiler, $@"{package.ContentDirectory}\newrelic\x86"); Directory.CreateDirectory($@"{rootDirectory}\logs"); System.IO.File.Create($@"{rootDirectory}\logs\placeholder").Dispose(); frameworkAgentComponents.CopyComponents($@"{package.GetContentFilesDirectory("any", "net45")}\newrelic"); FileHelpers.CopyFile(frameworkAgentX86Components.WindowsProfiler, $@"{package.GetContentFilesDirectory("any", "net45")}\newrelic\x86"); Directory.CreateDirectory($@"{StagingDirectory}\contentFiles\any\net45\newrelic\logs"); System.IO.File.Create($@"{StagingDirectory}\contentFiles\any\net45\newrelic\logs\placeholder").Dispose(); coreAgentComponents.CopyComponents($@"{package.GetContentFilesDirectory("any", "netstandard2.0")}\newrelic"); FileHelpers.CopyFile(coreAgentX86Components.WindowsProfiler, $@"{package.GetContentFilesDirectory("any", "netstandard2.0")}\newrelic\x86"); package.CopyToContentFiles(coreAgentComponents.LinuxProfiler, @"any\netstandard2.0\newrelic"); package.CopyToContentFiles(coreAgentComponents.GRPCExtensionsLibLinux, @"any\netstandard2.0\newrelic"); Directory.CreateDirectory($@"{StagingDirectory}\contentFiles\any\netstandard2.0\newrelic\logs"); System.IO.File.Create($@"{StagingDirectory}\contentFiles\any\netstandard2.0\newrelic\logs\placeholder").Dispose(); package.CopyAll(PackageDirectory); var agentInfo = new AgentInfo { InstallType = "NugetAgent" }; var newRelicConfigPaths = new[] { $@"{rootDirectory}\newrelic.config", $@"{StagingDirectory}\contentFiles\any\net45\newrelic\newrelic.config", $@"{StagingDirectory}\contentFiles\any\netstandard2.0\newrelic\newrelic.config", }; foreach (var newRelicConfigPath in newRelicConfigPaths) { TransformNewRelicConfig(newRelicConfigPath); agentInfo.WriteToDisk(Path.GetDirectoryName(newRelicConfigPath)); } package.SetVersion(frameworkAgentComponents.Version); package.Pack(); }
protected override void InternalBuild() { var frameworkAgentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); frameworkAgentComponents.ValidateComponents(); var package = new NugetPackage(StagingDirectory, OutputDirectory); package.CopyAll(PackageDirectory); DoInstallerReplacements($"NewRelicAgent_x64_{frameworkAgentComponents.Version}.msi"); package.CopyToLib(frameworkAgentComponents.AgentApiDll); package.CopyToContent($@"{RepoRootDirectory}\src\_build\x64-{Configuration}\Installer\NewRelicAgent_x64_{frameworkAgentComponents.Version}.msi"); package.SetVersion(frameworkAgentComponents.Version); package.Pack(); }
protected override void InternalBuild() { var frameworkAgentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); var coreAgentComponents = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); frameworkAgentComponents.ValidateComponents(); coreAgentComponents.ValidateComponents(); var package = new NugetPackage(StagingDirectory, OutputDirectory); package.CopyAll(PackageDirectory); package.CopyToLib(frameworkAgentComponents.AgentApiDll, "net45"); package.CopyToLib(coreAgentComponents.AgentApiDll, "netstandard2.0"); package.CopyToRoot(frameworkAgentComponents.NewRelicLicenseFile); package.CopyToRoot(frameworkAgentComponents.NewRelicThirdPartyNoticesFile); package.SetVersion(frameworkAgentComponents.Version); package.Pack(); }
protected override void InternalBuild() { _agentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, Platform, RepoRootDirectory, HomeRootDirectory); _agentComponents.ValidateComponents(); var package = new NugetPackage(StagingDirectory, OutputDirectory); _agentComponents.CopyComponents($@"{package.ContentDirectory}\newrelic"); package.CopyToLib(_agentComponents.AgentApiDll); package.CopyAll(PackageDirectory); TransformNewRelicConfig(); var agentInfo = new AgentInfo { InstallType = $"NugetAzureWebsites{Platform}" }; agentInfo.WriteToDisk(RootDirectory); package.SetVersion(_agentComponents.Version); package.Pack(); }
protected override void InternalBuild() { var x64Components = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, "x64", RepoRootDirectory, HomeRootDirectory); var x86Components = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, "x86", RepoRootDirectory, HomeRootDirectory); x64Components.ValidateComponents(); x86Components.ValidateComponents(); FileHelpers.DeleteDirectories(StagingDirectory, OutputDirectory); var agentInfox64 = new AgentInfo { InstallType = "ScriptableCore" }; x64Components.CopyComponents($@"{StagingDirectory}\x64"); x86Components.CopyComponents($@"{StagingDirectory}\x86"); agentInfox64.WriteToDisk($@"{StagingDirectory}\x64"); agentInfox64.WriteToDisk($@"{StagingDirectory}\x86"); FileHelpers.CopyFile($@"{RepoRootDirectory}\build\Packaging\CoreInstaller\installAgent.ps1", StagingDirectory); FileHelpers.CopyFile($@"{RepoRootDirectory}\build\Packaging\CoreInstaller\installAgentUsage.txt", StagingDirectory); var zipFilePath = $@"{OutputDirectory}\newrelic-netcore20-agent-win-installer_{x64Components.Version}.zip"; Directory.CreateDirectory(OutputDirectory); System.IO.Compression.ZipFile.CreateFromDirectory(StagingDirectory, zipFilePath); File.WriteAllText($@"{OutputDirectory}\checksum.sha256", FileHelpers.GetSha256Checksum(zipFilePath)); // For now, the DotNet-Core20-Agent-DeployToS3 job expects core agent artifacts to be in the following directory // At some point we should change the job to pull from the new location under the Build\BuildArtifacts directory FileHelpers.CopyFile(zipFilePath, $@"{RepoRootDirectory}\src\_build\CoreArtifacts"); // We put a readme file for the core agent on the download site: http://download.newrelic.com/dot_net_agent/core_20/current/ // This readme also gets picked up by the DotNet-Core20-Agent-DeployToS3 job. CopyCoreReadme(); Console.WriteLine($"Successfully created artifact for {nameof(CoreInstaller)}."); }
private void ValidateWxsDefinitionFileForInstaller() { //Verify that the expected agent components are in the homebuilder for the installer var frameworkAgentComponents = AgentComponents.GetAgentComponents(AgentType.Framework, Configuration, Platform, RepoRootDirectory, HomeRootDirectory); frameworkAgentComponents.ValidateComponents(); var coreAgentComponents = AgentComponents.GetAgentComponents(AgentType.Core, Configuration, Platform, RepoRootDirectory, HomeRootDirectory); coreAgentComponents.ValidateComponents(); var productWxs = GetParsedProductWxsData(); // Framework var extensionGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "NewRelic.Agent.Extensions"); var instrumentationGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "NewRelic.Agent.Extensions.Instrumentation"); var frameworkExtensionsComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "ExtensionsComponents"); var frameworkConfigurationComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "ConfigurationComponents"); var frameworkRegistryComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "RegistryComponents"); var frameworkProgramsComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "ProgramsComponents"); var frameworkIISRegistryComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "IISRegistryComponents"); var frameworkProductComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "ProductComponents"); // Core var coreExtensionGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "CoreNewRelic.Agent.Extensions"); var coreInstrumentationGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "CoreNewRelic.Agent.Extensions.Instrumentation"); var coreIISRegistryComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "CoreIISRegistryComponents"); var coreProductComponentsGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "CoreProductComponents"); // All installs var uninstallComponent = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "UninstallComponents") .Component.First(); var globalApiComponentGroup = productWxs.Fragment.Items .OfType <WixFragmentComponentGroup>() .First(cg => cg.Id == "ApiComponents"); ValidateWixFileExtensionDefinitions(extensionGroup); ValidateWixFileExtensionDefinitions(coreExtensionGroup, isCore: true); ValidateWixFileExtensionDefinitions(instrumentationGroup); ValidateWixFileExtensionDefinitions(coreInstrumentationGroup, isCore: true); ValidateWixFileExtensionDefinitions(frameworkExtensionsComponentsGroup); ValidateWixRegistryDefinitions(frameworkRegistryComponentsGroup); ValidateWixRegistryDefinitions(frameworkProgramsComponentsGroup); ValidateWixRegistryDefinitions(frameworkProductComponentsGroup); ValidateWixRegistryDefinitions(coreProductComponentsGroup); ValidateWixUninstallComponents(uninstallComponent); ValidateWixIisRegistryDefinitions(frameworkIISRegistryComponentsGroup, coreIISRegistryComponentsGroup); ValidateAgentComponentsAndWixReferenceTheSameFiles(frameworkAgentComponents.ExtensionDirectoryComponents, extensionGroup, frameworkExtensionsComponentsGroup); ValidateAgentComponentsAndWixReferenceTheSameFiles(frameworkAgentComponents.WrapperXmlFiles, instrumentationGroup); ValidateAgentComponentsAndWixReferenceTheSameFiles(frameworkAgentComponents.ConfigurationComponents, frameworkConfigurationComponentsGroup); ValidateAgentComponentsAndWixReferenceTheSameFiles(CreateReadOnlyCollection(coreAgentComponents.AgentApiDll), globalApiComponentGroup); ValidateAgentComponentsAndWixReferenceTheSameFiles(CreateReadOnlyCollection(frameworkAgentComponents.AgentApiDll), globalApiComponentGroup); }