Skip to content

Commit

Permalink
generate linux specific native artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Apr 1, 2020
1 parent 64ea37a commit 12278d0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 6 additions & 3 deletions build/pack.cake
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ void PackPrepareNative(ICakeContext context, BuildParameters parameters)

context.Information("Validating native lib:");

var nativeExe = outputPath.CombineWithFilePath(IsRunningOnWindows() ? "gitversion.exe" : "gitversion");
ValidateOutput(nativeExe.FullPath, "/showvariable FullSemver", parameters.Version.GitVersion.FullSemVer);
// testing windows and macos artifacts, ther linux is tested with docker
if (platform != PlatformFamily.Linux)
{
var nativeExe = outputPath.CombineWithFilePath(IsRunningOnWindows() ? "gitversion.exe" : "gitversion");
ValidateOutput(nativeExe.FullPath, "/showvariable FullSemver", parameters.Version.GitVersion.FullSemVer);
}
}

}
8 changes: 5 additions & 3 deletions build/utils/docker.cake
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ void DockerPullImage(DockerImage dockerImage, BuildParameters parameters)
DockerContainerRunSettings GetDockerRunSettings(BuildParameters parameters)
{
var currentDir = MakeAbsolute(Directory("."));
var root = parameters.DockerRootPrefix;
var settings = new DockerContainerRunSettings
{
Rm = true,
Volume = new[]
{
$"{currentDir}:{parameters.DockerRootPrefix}/repo",
$"{currentDir}/artifacts/v{parameters.Version.SemVersion}/nuget:{parameters.DockerRootPrefix}/nuget",
$"{currentDir}/test-scripts:{parameters.DockerRootPrefix}/scripts"
$"{currentDir}:{root}/repo",
$"{currentDir}/test-scripts:{root}/scripts",
$"{currentDir}/artifacts/v{parameters.Version.SemVersion}/nuget:{root}/nuget",
$"{currentDir}/artifacts/v{parameters.Version.SemVersion}/native/linux:{root}/native",
}
};

Expand Down
2 changes: 1 addition & 1 deletion build/utils/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public class BuildParameters
NativeRuntimes = new Dictionary<PlatformFamily, string[]>
{
[PlatformFamily.Windows] = new[] { "win-x64", "win-x86" },
[PlatformFamily.Linux] = new[] { "linux-x64" },
[PlatformFamily.Linux] = new[] { "debian.9-x64", "centos.7-x64", "fedora.30-x64", "ubuntu.16.04-x64", "ubuntu.18.04-x64" },
[PlatformFamily.OSX] = new[] { "osx-x64" },
};

Expand Down
4 changes: 2 additions & 2 deletions test-scripts/Test-DotnetGlobalTool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ param(
[parameter(Mandatory=$true, Position=2)][string] $repoPath
)

$result = dotnet tool install GitVersion.Tool --version $version --tool-path $rootPrefix/tools --add-source $nugetPath | out-null;
$result = dotnet tool install GitVersion.Tool --version $version --tool-path /tools --add-source $nugetPath | out-null;

if($LASTEXITCODE -eq 0) {
& "$rootPrefix/tools/dotnet-gitversion" $repoPath /showvariable FullSemver;
& "/tools/dotnet-gitversion" $repoPath /showvariable FullSemver;
} else {
Write-Output $result
}

0 comments on commit 12278d0

Please sign in to comment.