Skip to content

Commit beda77b

Browse files
Update nuke to 9.0.4 (#1192)
1 parent 10f62ae commit beda77b

5 files changed

Lines changed: 62 additions & 88 deletions

File tree

build/Build.Pack.cs

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ void CreateLinuxPackages(string runtimeId)
9595
packagingScriptsDirectory /= "unsigned";
9696

9797
packagingScriptsDirectory.GlobFiles("*")
98-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, debBuildDir / "scripts"));
98+
.ForEach(x => x.CopyToDirectory(debBuildDir / "scripts"));
9999

100100
DockerTasks.DockerPull(settings => settings
101-
.When(RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64"))
101+
.When(_ => RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64"))
102102
.SetName(dockerToolsContainerImage));
103103

104104
DockerTasks.DockerRun(settings => settings
105-
.When(RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64"))
105+
.When(_ => RuntimeInformation.OSArchitecture == Architecture.Arm64, _ => _.SetPlatform("linux/amd64"))
106106
.EnableRm()
107107
.EnableTty()
108108
.SetEnv(
@@ -132,13 +132,13 @@ void CreateLinuxPackages(string runtimeId)
132132

133133
(ArtifactsDirectory / "deb").CreateDirectory();
134134
debOutputDirectory.GlobFiles("*.deb")
135-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, ArtifactsDirectory / "deb"));
135+
.ForEach(x => x.CopyToDirectory(ArtifactsDirectory / "deb"));
136136

137137
CopyDebianPackageToDockerFolder(runtimeId);
138138

139139
(ArtifactsDirectory / "rpm").CreateDirectory();
140140
debOutputDirectory.GlobFiles("*.rpm")
141-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, ArtifactsDirectory / "rpm"));
141+
.ForEach(x => x.CopyToDirectory(ArtifactsDirectory / "rpm"));
142142
}
143143
});
144144

@@ -245,7 +245,7 @@ void PackWindowsZip(string framework, string runtimeId)
245245
workingTentacleDirectory.CreateOrCleanDirectory();
246246

247247
(BuildDirectory / "Tentacle" / framework / runtimeId).GlobFiles($"*")
248-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingTentacleDirectory));
248+
.ForEach(x => x.CopyToDirectory(workingTentacleDirectory));
249249

250250
ZipFile.CreateFromDirectory(
251251
workingDirectory,
@@ -267,23 +267,23 @@ void PackWindowsInstallers(MSBuildTargetPlatform platform, AbsolutePath wixNuget
267267
if (framework == NetFramework)
268268
{
269269
(BuildDirectory / "Tentacle" / framework / "win").GlobFiles("*")
270-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite));
270+
.ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite));
271271

272272
(BuildDirectory / "Octopus.Manager.Tentacle" / framework / "win").GlobFiles("*")
273-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite));
273+
.ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite));
274274
}
275275
else if (framework is NetCoreWindows)
276276
{
277277
(BuildDirectory / "Tentacle" / framework / $"win-{platform}").GlobFiles("*")
278-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite));
278+
.ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite));
279279

280280
(BuildDirectory / "Octopus.Manager.Tentacle" / framework / $"win-{platform}").GlobFiles("*")
281-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite));
281+
.ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite));
282282
}
283283
else
284284
{
285285
(BuildDirectory / "Tentacle" / framework / $"win-{platform}").GlobFiles("*")
286-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, installerDirectory, FileExistsPolicy.Overwrite));
286+
.ForEach(x => x.CopyToDirectory(installerDirectory, ExistsPolicy.FileOverwrite));
287287
}
288288

289289
var harvestFilePath = RootDirectory / "installer" / "Octopus.Tentacle.Installer" / "Tentacle.Generated.wxs";
@@ -348,9 +348,7 @@ void BuildMsiInstallerForPlatform(MSBuildTargetPlatform platform, AbsolutePath w
348348
_ => $"-{framework}-win" + (platform == MSBuildTargetPlatform.x64 ? "-x64" : "-x86")
349349
};
350350

351-
FileSystemTasks.MoveFile(
352-
builtMsi,
353-
ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}{platformString}.msi");
351+
builtMsi.Move(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}{platformString}.msi");
354352
});
355353
}
356354

@@ -487,40 +485,40 @@ string ConstructRedHatPackageFilename(string packageName, string architecture)
487485
workingDirectory.CreateDirectory();
488486

489487
// Get .NET Framework 4.8 installers for Tentacle
490-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi", workingDirectory / "Octopus.Tentacle.msi");
491-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi", workingDirectory / "Octopus.Tentacle-x64.msi");
488+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi").Copy(workingDirectory / "Octopus.Tentacle.msi");
489+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-x64.msi");
492490

493491
// Get .NET 8.0 installers for Tentacle (w/o Tentacle Manager)
494-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi");
495-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi");
492+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi");
493+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi");
496494

497495
// Get .NET 8.0 installers for Tentacle (w/ Tentacle Manager)
498-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x86.msi");
499-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x64.msi");
496+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x86.msi");
497+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-windows-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-windows-win-x64.msi");
500498

501499
// Get .NET 8.0 installers for Tentacle Upgrader
502-
FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe");
503-
FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe");
500+
(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe");
501+
(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe");
504502

505503
// Get all .NET Framework 4.8 files (installers and archives) for Tentacle Upgrader
506504
var octopusTentacleUpgraderDirectory = BuildDirectory / "Octopus.Tentacle.Upgrader" / NetFramework / "win";
507-
octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDirectory));
505+
octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => x.CopyToDirectory(workingDirectory));
508506

509507
// Get all DEB packages for Linux
510508
var debAmd64PackageFilename = ConstructDebianPackageFilename("tentacle", "amd64");
511509
var debArm64PackageFilename = ConstructDebianPackageFilename("tentacle", "arm64");
512510
var debArm32PackageFilename = ConstructDebianPackageFilename("tentacle", "armhf");
513-
FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debAmd64PackageFilename, workingDirectory / debAmd64PackageFilename);
514-
FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debArm64PackageFilename, workingDirectory / debArm64PackageFilename);
515-
FileSystemTasks.CopyFile(ArtifactsDirectory / "deb" / debArm32PackageFilename, workingDirectory / debArm32PackageFilename);
511+
(ArtifactsDirectory / "deb" / debAmd64PackageFilename).Copy(workingDirectory / debAmd64PackageFilename);
512+
(ArtifactsDirectory / "deb" / debArm64PackageFilename).Copy(workingDirectory / debArm64PackageFilename);
513+
(ArtifactsDirectory / "deb" / debArm32PackageFilename).Copy(workingDirectory / debArm32PackageFilename);
516514

517515
// Get all RPM packages for Linux
518516
var rpmArm64PackageFilename = ConstructRedHatPackageFilename("tentacle", "aarch64");
519517
var rpmArm32PackageFilename = ConstructRedHatPackageFilename("tentacle", "armv7hl");
520518
var rpmx64PackageFilename = ConstructRedHatPackageFilename("tentacle", "x86_64");
521-
FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmArm64PackageFilename, workingDirectory / rpmArm64PackageFilename);
522-
FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmArm32PackageFilename, workingDirectory / rpmArm32PackageFilename);
523-
FileSystemTasks.CopyFile(ArtifactsDirectory / "rpm" / rpmx64PackageFilename, workingDirectory / rpmx64PackageFilename);
519+
(ArtifactsDirectory / "rpm" / rpmArm64PackageFilename).Copy(workingDirectory / rpmArm64PackageFilename);
520+
(ArtifactsDirectory / "rpm" / rpmArm32PackageFilename).Copy(workingDirectory / rpmArm32PackageFilename);
521+
(ArtifactsDirectory / "rpm" / rpmx64PackageFilename).Copy(workingDirectory / rpmx64PackageFilename);
524522

525523
// Get the archives for all runtimes
526524
foreach (var framework in new[] { NetFramework, NetCore })
@@ -531,15 +529,15 @@ string ConstructRedHatPackageFilename(string packageName, string architecture)
531529
|| runtimeId != "win" && framework == NetFramework) continue;
532530

533531
var fileExtension = runtimeId.StartsWith("win") ? "zip" : "tar.gz";
534-
FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{framework}-{runtimeId}.{fileExtension}",
535-
workingDirectory / $"tentacle-{framework}-{runtimeId}.{fileExtension}");
532+
var path = ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{framework}-{runtimeId}.{fileExtension}";
533+
path.Copy(workingDirectory / $"tentacle-{framework}-{runtimeId}.{fileExtension}");
536534
}
537535
}
538536

539537
// Get the .NET 8.0 archives for Tentacle (w/ Tentacle Manager)
540-
FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x86.zip",
538+
(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x86.zip").Copy(
541539
workingDirectory / $"tentacle-{NetCoreWindows}-win-x86.zip");
542-
FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x64.zip",
540+
(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCoreWindows}-win-x64.zip").Copy(
543541
workingDirectory / $"tentacle-{NetCoreWindows}-win-x64.zip");
544542

545543
// Assert all the expected files have been successfully copied
@@ -579,20 +577,20 @@ string ConstructRedHatPackageFilename(string packageName, string architecture)
579577
workingDirectory.CreateDirectory();
580578

581579
// Get the .NET Framework 4.8 installers for Tentacle
582-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi", workingDirectory / "Octopus.Tentacle.msi");
583-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi", workingDirectory / "Octopus.Tentacle-x64.msi");
580+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}.msi").Copy(workingDirectory / "Octopus.Tentacle.msi");
581+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-x64.msi");
584582

585583
// Get the .NET 8.0 installers for Tentacle
586-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi");
587-
FileSystemTasks.CopyFile(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi", workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi");
584+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x86.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x86.msi");
585+
(ArtifactsDirectory / "msi" / $"Octopus.Tentacle.{FullSemVer}-net8.0-win-x64.msi").Copy(workingDirectory / "Octopus.Tentacle-net8.0-win-x64.msi");
588586

589587
// Get the .NET 8.0 installers for the Tentacle Upgrader
590-
FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe");
591-
FileSystemTasks.CopyFile(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe", workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe");
588+
(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x86" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x86.exe");
589+
(BuildDirectory / "Octopus.Tentacle.Upgrader" / NetCore / "win-x64" / "Octopus.Tentacle.Upgrader.exe").Copy(workingDirectory / "Octopus.Tentacle.Upgrader-net8.0-win-x64.exe");
592590

593591
// Get the .NET Framework 4.8 installers for the Tentacle Upgrader
594592
var octopusTentacleUpgraderDirectory = BuildDirectory / "Octopus.Tentacle.Upgrader" / NetFramework / "win";
595-
octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDirectory));
593+
octopusTentacleUpgraderDirectory.GlobFiles("*").ForEach(x => x.CopyToDirectory(workingDirectory));
596594

597595
// Get the archives for all required runtimes
598596
foreach (var runtimeId in CrossPlatformBundleForServerRequiredRuntimes)
@@ -601,8 +599,8 @@ string ConstructRedHatPackageFilename(string packageName, string architecture)
601599
// as we've already manually grabbed the installers
602600
if (runtimeId.StartsWith("win")) continue;
603601

604-
FileSystemTasks.CopyFile(ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCore}-{runtimeId}.{"tar.gz"}",
605-
workingDirectory / $"tentacle-{NetCore}-{runtimeId}.{"tar.gz"}");
602+
var path = ArtifactsDirectory / "zip" / $"tentacle-{FullSemVer}-{NetCore}-{runtimeId}.{"tar.gz"}";
603+
path.Copy(workingDirectory / $"tentacle-{NetCore}-{runtimeId}.{"tar.gz"}");
606604
}
607605

608606
// Assert all the expected files have been successfully copied
@@ -660,9 +658,9 @@ void PackTarballs(string framework, string runtimeId)
660658
var tentacleDirectory = BuildDirectory / "Tentacle" / framework / runtimeId;
661659

662660
linuxPackagesContent.GlobFiles("*")
663-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDir / "tentacle"));
661+
.ForEach(x => x.CopyToDirectory(workingDir / "tentacle"));
664662
tentacleDirectory.GlobFiles("*")
665-
.ForEach(x => FileSystemTasks.CopyFileToDirectory(x, workingDir / "tentacle"));
663+
.ForEach(x => x.CopyToDirectory(workingDir / "tentacle"));
666664

667665
TarGZipCompress(
668666
workingDir,
@@ -726,7 +724,7 @@ void CopyDebianPackageToDockerFolder(string runtimeId)
726724
var dockerDir = ArtifactsDirectory / "docker";
727725
dockerDir.CreateDirectory();
728726

729-
FileSystemTasks.CopyFile(packageFilePath, dockerDir / $"tentacle_{FullSemVer}_linux-{dockerArch}.deb");
727+
packageFilePath.Copy(dockerDir / $"tentacle_{FullSemVer}_linux-{dockerArch}.deb");
730728
}
731729

732730
string GetMicrok8sIpAddress()

build/Build.Tests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,31 +219,31 @@ void ThenBuiltInUserShouldNotHaveWritePermissions(string destination)
219219

220220
void InstallMsi(AbsolutePath installerPath, AbsolutePath destination)
221221
{
222-
var installLogName = Path.Combine(TestDirectory, $"{GetTestName(installerPath)}.install.log");
222+
var installLogName = TestDirectory / $"{GetTestName(installerPath)}.install.log";
223223

224-
Log.Information($"Installing {installerPath} to {destination}");
224+
Log.Information("Installing {InstallerPath} to {Destination}", installerPath, destination);
225225

226226
var arguments = $"/i {installerPath} /QN INSTALLLOCATION={destination} /L*V {installLogName}";
227-
Log.Information($"Running msiexec {arguments}");
227+
Log.Information("Running msiexec {Arguments}", arguments);
228228
var installationProcess = ProcessTasks.StartProcess("msiexec", arguments);
229229
installationProcess.WaitForExit();
230230

231-
FileSystemTasks.CopyFileToDirectory(installLogName, ArtifactsDirectory, FileExistsPolicy.Overwrite);
231+
installLogName.CopyToDirectory(ArtifactsDirectory, ExistsPolicy.FileOverwrite);
232232
if (installationProcess.ExitCode != 0) {
233233
throw new Exception($"The installation process exited with a non-zero exit code ({installationProcess.ExitCode}). Check the log {installLogName} for details.");
234234
}
235235
}
236236

237237
void UninstallMsi(AbsolutePath installerPath)
238238
{
239-
Log.Information($"Uninstalling {installerPath}");
240-
var uninstallLogName = Path.Combine(TestDirectory, $"{GetTestName(installerPath)}.uninstall.log");
239+
Log.Information("Uninstalling {InstallerPath}", installerPath);
240+
var uninstallLogName = TestDirectory / $"{GetTestName(installerPath)}.uninstall.log";
241241

242242
var arguments = $"/x {installerPath} /QN /L*V {uninstallLogName}";
243-
Log.Information($"Running msiexec {arguments}");
243+
Log.Information("Running msiexec {Arguments}", arguments);
244244
var uninstallProcess = ProcessTasks.StartProcess("msiexec", arguments);
245245
uninstallProcess.WaitForExit();
246-
FileSystemTasks.CopyFileToDirectory(uninstallLogName, ArtifactsDirectory, FileExistsPolicy.Overwrite);
246+
(uninstallLogName).CopyToDirectory(ArtifactsDirectory, ExistsPolicy.FileOverwrite);
247247
}
248248

249249
[SupportedOSPlatform("windows")]

0 commit comments

Comments
 (0)