Skip to content
Merged
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
13 changes: 8 additions & 5 deletions build/Build.Docker.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using Calamari.Build.Utilities;
using JetBrains.Annotations;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.Docker;
using Nuke.Common.Tools.PowerShell;

namespace Calamari.Build;

public partial class Build
{
//Resolved from PATH so a missing gzip fails by name, rather than as a mystery exit code
static Tool Gzip => ToolResolver.GetPathTool("gzip");

[PublicAPI]
Target BuildDockerImages =>
d =>
Expand Down Expand Up @@ -82,10 +85,10 @@ public partial class Build
return settings;
});

//compress with gzip
PowerShellTasks.PowerShell(_ => _
.EnableNoProfile()
.SetCommand($"gzip -k -9 -f '{outputFile}'"));
//compress with gzip. Invoked directly rather than via pwsh, which only
//added a dependency on whatever .NET runtime the agent's `pwsh` global tool
//was built against - not the SDK this build pins.
Gzip($"-k -9 -f \"{outputFile}\"");

//gzip always uses the .gz suffix
var compressedZipPath = $"{outputFile}.gz";
Expand Down