Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify release process #616

Merged
merged 2 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 15 additions & 45 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{5D8E1F81
tools\GlobalSuppressions.cs = tools\GlobalSuppressions.cs
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenerateIntegrationDefinitions", "tools\GenerateIntegrationDefinitions\GenerateIntegrationDefinitions.csproj", "{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.ClrProfiler.Managed.Tests", "test\Datadog.Trace.ClrProfiler.Managed.Tests\Datadog.Trace.ClrProfiler.Managed.Tests.csproj", "{5B52C0C0-A554-4E53-9D17-B121E78FF919}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.MongoDB", "samples\Samples.MongoDB\Samples.MongoDB.csproj", "{3493346B-44F6-4F50-8FB4-51D0090DF544}"
Expand Down Expand Up @@ -244,8 +242,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azure-pipelines", ".azure-
.azure-pipelines\unit-tests.yml = .azure-pipelines\unit-tests.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SynchronizeVersions", "tools\SynchronizeVersions\SynchronizeVersions.csproj", "{7F0BD409-FA74-4FB1-853F-D10D888E1542}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.MySql", "samples\Samples.MySql\Samples.MySql.csproj", "{42FA33DD-AEA3-4FF3-8319-F30244A666A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TraceContext.InvalidOperationException", "reproductions\TraceContext.InvalidOperationException\TraceContext.InvalidOperationException.csproj", "{DF923186-5397-4E15-A95B-F15C8327ED53}"
Expand All @@ -260,8 +256,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.DatabaseHelper", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UpdateVendors", "tools\UpdateVendors\UpdateVendors.csproj", "{72FB583A-A1B0-4B5F-8658-617B100DCD8E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SynchronizeInstaller", "tools\SynchronizeInstaller\SynchronizeInstaller.csproj", "{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Log4Net.SerializationException", "reproductions\Log4Net.SerializationException\Log4Net.SerializationException.csproj", "{35F581E9-3D7C-4E80-8DFF-D437B0D86710}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithLog4Net", "reproduction-dependencies\ApplicationWithLog4Net\ApplicationWithLog4Net.csproj", "{1C34D970-6081-4EFA-8F2F-5AD2B146AC58}"
Expand Down Expand Up @@ -293,6 +287,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc21", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLog10LogsInjection.NullReferenceException", "reproductions\NLog10LogsInjection.NullReferenceException\NLog10LogsInjection.NullReferenceException.csproj", "{6209C19B-42E4-4FCF-A539-FD1E4F4A34DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrepareRelease", "tools\PrepareRelease\PrepareRelease.csproj", "{DAA6B000-5BED-4081-B5E0-B698BFB89415}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -513,18 +509,6 @@ Global
{6D86109F-B7C9-477D-86D7-45735A3A0818}.Release|x64.Build.0 = Release|x64
{6D86109F-B7C9-477D-86D7-45735A3A0818}.Release|x86.ActiveCfg = Release|x86
{6D86109F-B7C9-477D-86D7-45735A3A0818}.Release|x86.Build.0 = Release|x86
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|x64.Build.0 = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|x86.ActiveCfg = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Debug|x86.Build.0 = Debug|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|Any CPU.Build.0 = Release|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|x64.ActiveCfg = Release|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|x64.Build.0 = Release|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|x86.ActiveCfg = Release|Any CPU
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3}.Release|x86.Build.0 = Release|Any CPU
{5B52C0C0-A554-4E53-9D17-B121E78FF919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B52C0C0-A554-4E53-9D17-B121E78FF919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B52C0C0-A554-4E53-9D17-B121E78FF919}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -779,18 +763,6 @@ Global
{1A5E9F40-F3A5-4B59-9898-3DCD65C459C3}.Release|x64.Build.0 = Release|x64
{1A5E9F40-F3A5-4B59-9898-3DCD65C459C3}.Release|x86.ActiveCfg = Release|x86
{1A5E9F40-F3A5-4B59-9898-3DCD65C459C3}.Release|x86.Build.0 = Release|x86
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|x64.ActiveCfg = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|x64.Build.0 = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|x86.ActiveCfg = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Debug|x86.Build.0 = Debug|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|Any CPU.Build.0 = Release|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|x64.ActiveCfg = Release|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|x64.Build.0 = Release|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|x86.ActiveCfg = Release|Any CPU
{7F0BD409-FA74-4FB1-853F-D10D888E1542}.Release|x86.Build.0 = Release|Any CPU
{42FA33DD-AEA3-4FF3-8319-F30244A666A4}.Debug|Any CPU.ActiveCfg = Debug|x86
{42FA33DD-AEA3-4FF3-8319-F30244A666A4}.Debug|x64.ActiveCfg = Debug|x64
{42FA33DD-AEA3-4FF3-8319-F30244A666A4}.Debug|x64.Build.0 = Debug|x64
Expand Down Expand Up @@ -867,18 +839,6 @@ Global
{72FB583A-A1B0-4B5F-8658-617B100DCD8E}.Release|x64.Build.0 = Release|Any CPU
{72FB583A-A1B0-4B5F-8658-617B100DCD8E}.Release|x86.ActiveCfg = Release|Any CPU
{72FB583A-A1B0-4B5F-8658-617B100DCD8E}.Release|x86.Build.0 = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|x64.ActiveCfg = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|x64.Build.0 = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|x86.ActiveCfg = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Debug|x86.Build.0 = Debug|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|Any CPU.Build.0 = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|x64.ActiveCfg = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|x64.Build.0 = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|x86.ActiveCfg = Release|Any CPU
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63}.Release|x86.Build.0 = Release|Any CPU
{35F581E9-3D7C-4E80-8DFF-D437B0D86710}.Debug|Any CPU.ActiveCfg = Debug|x86
{35F581E9-3D7C-4E80-8DFF-D437B0D86710}.Debug|x64.ActiveCfg = Debug|x64
{35F581E9-3D7C-4E80-8DFF-D437B0D86710}.Debug|x64.Build.0 = Debug|x64
Expand Down Expand Up @@ -1015,6 +975,18 @@ Global
{6209C19B-42E4-4FCF-A539-FD1E4F4A34DB}.Release|x64.Build.0 = Release|x64
{6209C19B-42E4-4FCF-A539-FD1E4F4A34DB}.Release|x86.ActiveCfg = Release|x86
{6209C19B-42E4-4FCF-A539-FD1E4F4A34DB}.Release|x86.Build.0 = Release|x86
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|x64.ActiveCfg = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|x64.Build.0 = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|x86.ActiveCfg = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Debug|x86.Build.0 = Debug|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|Any CPU.Build.0 = Release|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|x64.ActiveCfg = Release|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|x64.Build.0 = Release|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|x86.ActiveCfg = Release|Any CPU
{DAA6B000-5BED-4081-B5E0-B698BFB89415}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -1039,7 +1011,6 @@ Global
{086FF8A0-9CEE-470A-9751-78B0F1340649} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{C98950B1-DC4B-43DA-974F-EF2CF325EC2B} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{6D86109F-B7C9-477D-86D7-45735A3A0818} = {65DF5743-B7B5-4BC8-8AB5-9DE596AF3FB8}
{5B844A49-CA3C-42CB-AD31-E44CD73FD1A3} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
{5B52C0C0-A554-4E53-9D17-B121E78FF919} = {8CEC2042-F11C-49F5-A674-2355793B600A}
{3493346B-44F6-4F50-8FB4-51D0090DF544} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{DD3E8ED8-A0E4-482E-A5ED-115E21D543C0} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
Expand All @@ -1066,15 +1037,13 @@ Global
{1A5E9F40-F3A5-4B59-9898-3DCD65C459C3} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{6ABAD006-E206-488E-ACA1-1AA73F9B5146} = {FEBCE7DC-9FD1-48A6-B911-71ABB240A030}
{C52D6695-4E05-4930-88F8-0EFF8056A967} = {FEBCE7DC-9FD1-48A6-B911-71ABB240A030}
{7F0BD409-FA74-4FB1-853F-D10D888E1542} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
{42FA33DD-AEA3-4FF3-8319-F30244A666A4} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{DF923186-5397-4E15-A95B-F15C8327ED53} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{E1706893-D3A5-43B9-9036-AEF49DB9600B} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{21D420EB-06D0-489D-A71C-C748BB46B8EF} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{48283691-0D4B-4ABD-B75B-EDFC682E1547} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{472DBA92-4FEA-4B9A-BA70-0E97B942E12D} = {FA03944C-2391-4C25-8979-2E078A8CE0DD}
{72FB583A-A1B0-4B5F-8658-617B100DCD8E} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
{EBDDF6D7-59B8-4831-80C6-458C1ABBFC63} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
{35F581E9-3D7C-4E80-8DFF-D437B0D86710} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{1C34D970-6081-4EFA-8F2F-5AD2B146AC58} = {641C9C61-53FD-4504-B8D9-84008BDB89D1}
{3BEACB10-89FE-4F74-8022-1A52F223CE82} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
Expand All @@ -1088,6 +1057,7 @@ Global
{303F8E41-691F-4453-AB7D-88A0036C0465} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{D141BD06-DD95-4CAF-85CD-657116E0DAD4} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{6209C19B-42E4-4FCF-A539-FD1E4F4A34DB} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{DAA6B000-5BED-4081-B5E0-B698BFB89415} = {5D8E1F81-B820-4736-B797-271B0FE787EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
Expand Down
62 changes: 62 additions & 0 deletions tools/Datadog.Core.Tools/DependencyHelpers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.IO;
using Datadog.Core.Tools;

namespace PrepareRelease.Tools
{
public static class DependencyHelpers
{
private const string RequiredBuildConfig = "Release";

public static string[] GetTracerReleaseBinContent(string frameworkMoniker, string extension = "dll")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You could probably even do some more code-sharing between these two methods

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure

{
var solutionDirectory = EnvironmentTools.GetSolutionDirectory();
var projectBin =
Path.Combine(
solutionDirectory,
"src",
"Datadog.Trace.ClrProfiler.Managed",
"bin",
RequiredBuildConfig);

var outputFolder = Path.Combine(projectBin, frameworkMoniker);

var filePaths = Directory.GetFiles(
outputFolder,
$"*.{extension}",
SearchOption.AllDirectories);

if (filePaths.Length == 0)
{
throw new Exception("Be sure to build in release mode before running this tool.");
}

return filePaths;
}

public static string[] GetProfilerReleaseBinContent(string architecture, string extension = "dll")
{
var solutionDirectory = EnvironmentTools.GetSolutionDirectory();
var outputFolder =
Path.Combine(
solutionDirectory,
"src",
"Datadog.Trace.ClrProfiler.Native",
"bin",
RequiredBuildConfig,
architecture);

var filePaths = Directory.GetFiles(
outputFolder,
$"*.{extension}",
SearchOption.AllDirectories);

if (filePaths.Length == 0)
{
throw new Exception("Be sure to build in release mode before running this tool.");
}

return filePaths;
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
using Datadog.Trace.ClrProfiler;
using Newtonsoft.Json;

namespace GenerateIntegrationDefinitions
namespace PrepareRelease
{
public static class Program
public static class GenerateIntegrationDefinitions
{
public static void Main(string[] args)
public static void Run()
{
Console.WriteLine("Updating the integrations definitions");

var integrationsAssembly = typeof(Instrumentation).Assembly;

// find all methods in Datadog.Trace.ClrProfiler.Managed.dll with [InterceptMethod]
Expand Down Expand Up @@ -79,11 +81,6 @@ from targetAssembly in item.attribute.TargetAssemblies

string filename = "integrations.json";

if (args.Length > 0 && !string.IsNullOrWhiteSpace(args[0]))
{
filename = args[0];
}

var utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
File.WriteAllText(filename, json, utf8NoBom);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Datadog.Trace.ClrProfiler.Managed\Datadog.Trace.ClrProfiler.Managed.csproj" />
<ProjectReference Include="..\..\test\Datadog.Trace.TestHelpers\Datadog.Trace.TestHelpers.csproj" />
</ItemGroup>

Expand Down
41 changes: 41 additions & 0 deletions tools/PrepareRelease/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Linq;

namespace PrepareRelease
{
public class Program
{
public const string Versions = "versions";
public const string Integrations = "integrations";
public const string Msi = "msi";

public static void Main(string[] args)
{
if (JobShouldRun(Integrations, args))
{
Console.WriteLine("--------------- Integrations Job Started ---------------");
GenerateIntegrationDefinitions.Run();
Console.WriteLine("--------------- Integrations Job Complete ---------------");
}

if (JobShouldRun(Versions, args))
{
Console.WriteLine("--------------- Versions Job Started ---------------");
SetAllVersions.Run();
Console.WriteLine("--------------- Versions Job Complete ---------------");
}

if (JobShouldRun(Msi, args))
{
Console.WriteLine("--------------- MSI Job Started ---------------");
SyncMsiContent.Run();
Console.WriteLine("--------------- MSI Job Complete ---------------");
}
}

private static bool JobShouldRun(string jobName, string[] args)
{
return args.Length == 0 || args.Any(a => string.Equals(a, jobName, StringComparison.OrdinalIgnoreCase));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using System.Text.RegularExpressions;
using Datadog.Core.Tools;

namespace SynchronizeVersions
namespace PrepareRelease
{
public class Program
public static class SetAllVersions
{
public static void Main(string[] args)
public static void Run()
{
Console.WriteLine($"Updating version instances to {VersionString()}");

Expand Down Expand Up @@ -76,6 +76,11 @@ public static void Main(string[] args)
Console.WriteLine($"Completed synchronizing versions to {VersionString()}");
}

private static string AzureAppServicesReplace(string text)
{
return Regex.Replace(text, VersionPattern("_"), VersionString("_"), RegexOptions.Singleline);
}

private static string FullVersionReplace(string text, string split)
{
return Regex.Replace(text, VersionPattern(split), VersionString(split), RegexOptions.Singleline);
Expand All @@ -96,6 +101,11 @@ private static string NugetVersionReplace(string text)
return Regex.Replace(text, $"<Version>{VersionPattern(withPrereleasePostfix: true)}</Version>", $"<Version>{VersionString(withPrereleasePostfix: true)}</Version>", RegexOptions.Singleline);
}

private static string NuspecVersionReplace(string text)
{
return Regex.Replace(text, $"<version>{VersionPattern(withPrereleasePostfix: true)}</version>", $"<version>{VersionString(withPrereleasePostfix: true)}</version>", RegexOptions.Singleline);
}

private static string WixProjReplace(string text)
{
text = Regex.Replace(
Expand Down
Loading