diff --git a/build/Build.Pack.cs b/build/Build.Pack.cs index fa54a395c..2f5a9449b 100644 --- a/build/Build.Pack.cs +++ b/build/Build.Pack.cs @@ -95,14 +95,14 @@ void CreateLinuxPackages(string runtimeId) packagingScriptsDirectory /= "unsigned"; packagingScriptsDirectory.GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, debBuildDir / "scripts")); + .ForEach(x => x.CopyToDirectory(debBuildDir / "scripts")); DockerTasks.DockerPull(settings => settings - .When(RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64")) + .When(_ => RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64")) .SetName(dockerToolsContainerImage)); DockerTasks.DockerRun(settings => settings - .When(RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64")) + .When(_ => RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64")) .EnableRm() .EnableTty() .SetEnv( @@ -132,13 +132,13 @@ void CreateLinuxPackages(string runtimeId) (ArtifactsDirectory / "deb").CreateDirectory(); debOutputDirectory.GlobFiles("*.deb") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, ArtifactsDirectory / "deb")); + .ForEach(x => x.CopyToDirectory(ArtifactsDirectory / "deb")); CopyDebianPackageToDockerFolder(runtimeId); (ArtifactsDirectory / "rpm").CreateDirectory(); debOutputDirectory.GlobFiles("*.rpm") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, ArtifactsDirectory / "rpm")); + .ForEach(x => x.CopyToDirectory(ArtifactsDirectory / "rpm")); } }); @@ -245,7 +245,7 @@ void PackWindowsZip(string framework, string runtimeId) workingTentacleDirectory.CreateOrCleanDirectory(); (BuildDirectory / "Tentacle" / framework / runtimeId).GlobFiles($"*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingTentacleDirectory)); + .ForEach(x => x.CopyToDirectory(workingTentacleDirectory)); ZipFile.CreateFromDirectory( workingDirectory, @@ -267,23 +267,23 @@ void PackWindowsInstallers(MSBuildTargetPlatform platform, AbsolutePath wixNuget if (framework == NetFramework) { (BuildDirectory / "Tentacle" / framework / "win").GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite)); + .ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite)); (BuildDirectory / "Octopus.Manager.Tentacle" / framework / "win").GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite)); + .ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite)); } else if (framework is NetCoreWindows) { (BuildDirectory / "Tentacle" / framework / $"win-{platform}").GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite)); + .ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite)); (BuildDirectory / "Octopus.Manager.Tentacle" / framework / $"win-{platform}").GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite)); + .ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite)); } else { (BuildDirectory / "Tentacle" / framework / $"win-{platform}").GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite)); + .ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite)); } var harvestFilePath = RootDirectory / "installer" / "Octopus.Tentacle.Installer" / "Tentacle.Generated.wxs"; @@ -348,9 +348,7 @@ void BuildMsiInstallerForPlatform(MSBuildTargetPlatform platform, AbsolutePath w _ => $"-{framework}-win" + (platform == MSBuildTargetPlatform.x64 ? "-x64" : "-x86") }; - FileSystemTasks.MoveFile( - builtMsi, - ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}{platformString}.msi"); + builtMsi.Move(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}{platformString}.msi"); }); } @@ -487,40 +485,40 @@ string ConstructRedHatPackageFilename(string packageName, string architecture) workingDirectory.CreateDirectory(); // Get .NET Framework 4.8 installers for Tentacle - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi", workingDirectory / "Octopus.Tentacle.msi"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi", workingDirectory / "Octopus.Tentacle-x64.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi").Copy(workingDirectory / "Octopus.Tentacle.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-x64.msi"); // Get .NET 8.0 installers for Tentacle (w/o Tentacle Manager) - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi"); // Get .NET 8.0 installers for Tentacle (w/ Tentacle Manager) - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x86.msi"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x64.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x86.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x64.msi"); // Get .NET 8.0 installers for Tentacle Upgrader - FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe"); - FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe"); + (BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe"); + (BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe"); // Get all .NET Framework 4.8 files (installers and archives) for Tentacle Upgrader var octopusTentacleUpgraderDirectory = BuildDirectory / "Octopus.Tentacle.Upgrader" / NetFramework / "win"; - octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDirectory)); + octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => x.CopyToDirectory(workingDirectory)); // Get all DEB packages for Linux var debAmd64PackageFilename = ConstructDebianPackageFilename("tentacle", "amd64"); var debArm64PackageFilename = ConstructDebianPackageFilename("tentacle", "arm64"); var debArm32PackageFilename = ConstructDebianPackageFilename("tentacle", "armhf"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debAmd64PackageFilename, workingDirectory / debAmd64PackageFilename); - FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debArm64PackageFilename, workingDirectory / debArm64PackageFilename); - FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debArm32PackageFilename, workingDirectory / debArm32PackageFilename); + (ArtifactsDirectory / "deb" / debAmd64PackageFilename).Copy(workingDirectory / debAmd64PackageFilename); + (ArtifactsDirectory / "deb" / debArm64PackageFilename).Copy(workingDirectory / debArm64PackageFilename); + (ArtifactsDirectory / "deb" / debArm32PackageFilename).Copy(workingDirectory / debArm32PackageFilename); // Get all RPM packages for Linux var rpmArm64PackageFilename = ConstructRedHatPackageFilename("tentacle", "aarch64"); var rpmArm32PackageFilename = ConstructRedHatPackageFilename("tentacle", "armv7hl"); var rpmx64PackageFilename = ConstructRedHatPackageFilename("tentacle", "x86_64"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmArm64PackageFilename, workingDirectory / rpmArm64PackageFilename); - FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmArm32PackageFilename, workingDirectory / rpmArm32PackageFilename); - FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmx64PackageFilename, workingDirectory / rpmx64PackageFilename); + (ArtifactsDirectory / "rpm" / rpmArm64PackageFilename).Copy(workingDirectory / rpmArm64PackageFilename); + (ArtifactsDirectory / "rpm" / rpmArm32PackageFilename).Copy(workingDirectory / rpmArm32PackageFilename); + (ArtifactsDirectory / "rpm" / rpmx64PackageFilename).Copy(workingDirectory / rpmx64PackageFilename); // Get the archives for all runtimes foreach (var framework in new[] { NetFramework, NetCore }) @@ -531,15 +529,15 @@ string ConstructRedHatPackageFilename(string packageName, string architecture) || runtimeId != "win" && framework == NetFramework) continue; var fileExtension = runtimeId.StartsWith("win") ? "zip" : "tar.gz"; - FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{framework}-{runtimeId}.{fileExtension}", - workingDirectory / $"tentacle-{framework}-{runtimeId}.{fileExtension}"); + var path = ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{framework}-{runtimeId}.{fileExtension}"; + path.Copy(workingDirectory / $"tentacle-{framework}-{runtimeId}.{fileExtension}"); } } // Get the .NET 8.0 archives for Tentacle (w/ Tentacle Manager) - FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x86.zip", + (ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x86.zip").Copy( workingDirectory / $"tentacle-{NetCoreWindows}-win-x86.zip"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x64.zip", + (ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x64.zip").Copy( workingDirectory / $"tentacle-{NetCoreWindows}-win-x64.zip"); // Assert all the expected files have been successfully copied @@ -579,20 +577,20 @@ string ConstructRedHatPackageFilename(string packageName, string architecture) workingDirectory.CreateDirectory(); // Get the .NET Framework 4.8 installers for Tentacle - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi", workingDirectory / "Octopus.Tentacle.msi"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi", workingDirectory / "Octopus.Tentacle-x64.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi").Copy(workingDirectory / "Octopus.Tentacle.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-x64.msi"); // Get the .NET 8.0 installers for Tentacle - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi"); - FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi"); + (ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi"); // Get the .NET 8.0 installers for the Tentacle Upgrader - FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe"); - FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe"); + (BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe"); + (BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe"); // Get the .NET Framework 4.8 installers for the Tentacle Upgrader var octopusTentacleUpgraderDirectory = BuildDirectory / "Octopus.Tentacle.Upgrader" / NetFramework / "win"; - octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDirectory)); + octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => x.CopyToDirectory(workingDirectory)); // Get the archives for all required runtimes foreach (var runtimeId in CrossPlatformBundleForServerRequiredRuntimes) @@ -601,8 +599,8 @@ string ConstructRedHatPackageFilename(string packageName, string architecture) // as we've already manually grabbed the installers if (runtimeId.StartsWith("win")) continue; - FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCore}-{runtimeId}.{"tar.gz"}", - workingDirectory / $"tentacle-{NetCore}-{runtimeId}.{"tar.gz"}"); + var path = ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCore}-{runtimeId}.{"tar.gz"}"; + path.Copy(workingDirectory / $"tentacle-{NetCore}-{runtimeId}.{"tar.gz"}"); } // Assert all the expected files have been successfully copied @@ -660,9 +658,9 @@ void PackTarballs(string framework, string runtimeId) var tentacleDirectory = BuildDirectory / "Tentacle" / framework / runtimeId; linuxPackagesContent.GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDir / "tentacle")); + .ForEach(x => x.CopyToDirectory(workingDir / "tentacle")); tentacleDirectory.GlobFiles("*") - .ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDir / "tentacle")); + .ForEach(x => x.CopyToDirectory(workingDir / "tentacle")); TarGZipCompress( workingDir, @@ -726,7 +724,7 @@ void CopyDebianPackageToDockerFolder(string runtimeId) var dockerDir = ArtifactsDirectory / "docker"; dockerDir.CreateDirectory(); - FileSystemTasks.CopyFile(packageFilePath, dockerDir / $"tentacle_{FullSemVer}_linux-{dockerArch}.deb"); + packageFilePath.Copy(dockerDir / $"tentacle_{FullSemVer}_linux-{dockerArch}.deb"); } string GetMicrok8sIpAddress() diff --git a/build/Build.Tests.cs b/build/Build.Tests.cs index 39aada1c3..ed434f24f 100644 --- a/build/Build.Tests.cs +++ b/build/Build.Tests.cs @@ -219,16 +219,16 @@ void ThenBuiltInUserShouldNotHaveWritePermissions(string destination) void InstallMsi(AbsolutePath installerPath, AbsolutePath destination) { - var installLogName = Path.Combine(TestDirectory, $"{GetTestName(installerPath)}.install.log"); + var installLogName = TestDirectory / $"{GetTestName(installerPath)}.install.log"; - Log.Information($"Installing {installerPath} to {destination}"); + Log.Information("Installing {InstallerPath} to {Destination}", installerPath, destination); var arguments = $"/i {installerPath} /QN INSTALLLOCATION={destination} /L*V {installLogName}"; - Log.Information($"Running msiexec {arguments}"); + Log.Information("Running msiexec {Arguments}", arguments); var installationProcess = ProcessTasks.StartProcess("msiexec", arguments); installationProcess.WaitForExit(); - FileSystemTasks.CopyFileToDirectory(installLogName, ArtifactsDirectory, FileExistsPolicy.Overwrite); + installLogName.CopyToDirectory(ArtifactsDirectory, ExistsPolicy.FileOverwrite); if (installationProcess.ExitCode != 0) { throw new Exception($"The installation process exited with a non-zero exit code ({installationProcess.ExitCode}). Check the log {installLogName} for details."); } @@ -236,14 +236,14 @@ void InstallMsi(AbsolutePath installerPath, AbsolutePath destination) void UninstallMsi(AbsolutePath installerPath) { - Log.Information($"Uninstalling {installerPath}"); - var uninstallLogName = Path.Combine(TestDirectory, $"{GetTestName(installerPath)}.uninstall.log"); + Log.Information("Uninstalling {InstallerPath}", installerPath); + var uninstallLogName = TestDirectory / $"{GetTestName(installerPath)}.uninstall.log"; var arguments = $"/x {installerPath} /QN /L*V {uninstallLogName}"; - Log.Information($"Running msiexec {arguments}"); + Log.Information("Running msiexec {Arguments}", arguments); var uninstallProcess = ProcessTasks.StartProcess("msiexec", arguments); uninstallProcess.WaitForExit(); - FileSystemTasks.CopyFileToDirectory(uninstallLogName, ArtifactsDirectory, FileExistsPolicy.Overwrite); + (uninstallLogName).CopyToDirectory(ArtifactsDirectory, ExistsPolicy.FileOverwrite); } [SupportedOSPlatform("windows")] diff --git a/build/Build.cs b/build/Build.cs index 307e1fc93..aaa8bb439 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -17,29 +17,11 @@ using Nuke.Common.Tools.OctoVersion; using Nuke.Common.Utilities.Collections; using Serilog; -using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; [ShutdownDotNetAfterServerBuild] partial class Build : NukeBuild { - public Build() - { - // Docker typically logs everything to stderr so we're - // redirecting it to Debug to make the logs look a bit nicer. - DockerTasks.DockerLogger = (outputType, message) => - { - if (outputType == OutputType.Err) - { - Log.Debug(message); - } - else - { - Log.Information(message); - } - }; - } - /// Support plugins are available for: /// - JetBrains ReSharper https://nuke.build/resharper /// - JetBrains Rider https://nuke.build/rider @@ -174,7 +156,7 @@ public Build() (BuildDirectory / "Tentacle" / NetCoreWindows / "win-x86"), (BuildDirectory / "Tentacle" / NetCoreWindows / "win-x64"), }; - directoriesToCopyHardenScriptInto.ForEach(dir => CopyFileToDirectory(hardenInstallationDirectoryScript, dir, FileExistsPolicy.Overwrite)); + directoriesToCopyHardenScriptInto.ForEach(dir => hardenInstallationDirectoryScript.CopyToDirectory(dir, ExistsPolicy.FileOverwrite)); // Sign any unsigned libraries that Octopus Deploy authors so that they play nicely with security scanning tools. // Refer: https://octopusdeploy.slack.com/archives/C0K9DNQG5/p1551655877004400 @@ -248,7 +230,7 @@ public Build() .Executes(() => { LocalPackagesDirectory.CreateDirectory(); - CopyFileToDirectory(ArtifactsDirectory / "Chocolatey" / $"OctopusDeploy.Tentacle.{NuGetVersion}.nupkg", LocalPackagesDirectory); + (ArtifactsDirectory / "Chocolatey" / $"OctopusDeploy.Tentacle.{NuGetVersion}.nupkg").CopyToDirectory(LocalPackagesDirectory); }); [PublicAPI] @@ -262,9 +244,9 @@ public Build() .Executes(() => { LocalPackagesDirectory.CreateDirectory(); - CopyFileToDirectory(ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Contracts.{FullSemVer}.nupkg", LocalPackagesDirectory); - CopyFileToDirectory(ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Client.{FullSemVer}.nupkg", LocalPackagesDirectory); - CopyFileToDirectory(ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Core.{FullSemVer}.nupkg", LocalPackagesDirectory); + (ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Contracts.{FullSemVer}.nupkg").CopyToDirectory(LocalPackagesDirectory); + (ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Client.{FullSemVer}.nupkg").CopyToDirectory(LocalPackagesDirectory); + (ArtifactsDirectory / "nuget" / $"Octopus.Tentacle.Core.{FullSemVer}.nupkg").CopyToDirectory(LocalPackagesDirectory); }); [PublicAPI] @@ -322,13 +304,10 @@ void RunBuildFor(string framework, string runtimeId) .SetRuntime(runtimeId) .EnableNoRestore() .SetVersion(FullSemVer) - .SetProcessArgumentConfigurator(args => - { - // There is a race condition in dotnet publish where building the entire solution - // can cause locking issues depending on multiple CPUs. The solution is to not run builds in parallel - // https://github.com/dotnet/sdk/issues/9585 - return args.Add("-maxcpucount:1"); - })); + // There is a race condition in dotnet publish where building the entire solution + // can cause locking issues depending on multiple CPUs. The solution is to not run builds in parallel + // https://github.com/dotnet/sdk/issues/9585 + .AddProcessAdditionalArguments("-maxcpucount:1")); } // We need to use tar directly, because .NET utilities aren't able to preserve the file permissions diff --git a/build/Build.sbom.cs b/build/Build.sbom.cs index 8227ee0b4..9ff70c27e 100644 --- a/build/Build.sbom.cs +++ b/build/Build.sbom.cs @@ -34,9 +34,6 @@ partial class Build { var combinedFileName = $"tentacle.{OctoVersionInfo.FullSemVer}-sbom.cdx.json"; - // redirect all docker output to stdout, as lots of it goes as stderr when it's just progress messages - DockerTasks.DockerLogger = (_, message) => Log.Information("[Docker] {Message}", message); - EnsureDockerImagesExistLocally(); var folderToSearchForDepsJson = ResolvePathToDepsJsonFiles(); @@ -166,7 +163,7 @@ await Logging.InBlock($"Uploading SBOM to Dependency Track", () => $"SBOM_UPLOADER_TAGS={projectName},{parentName}") .SetArgs(args) .SetRm(true) - .SetProcessLogInvocation(false)); // don't log the invocation, as in this version of nuke (8.1.4), it logs the api key + .AddProcessRedactedSecrets(DependencyTrackApiKey)); return Task.CompletedTask; }); diff --git a/build/_build.csproj b/build/_build.csproj index e5325f790..80f35fe22 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -11,7 +11,7 @@ - +