2023-09-27 14:33:19 -04:00
|
|
|
|
2024-05-08 11:59:55 +02:00
|
|
|
#!/usr/bin/env powershell
|
2025-09-25 16:53:55 +02:00
|
|
|
[CmdletBinding(PositionalBinding = $false)]
|
2025-05-02 10:54:46 +02:00
|
|
|
param (
|
2025-09-25 16:53:55 +02:00
|
|
|
[ValidateSet('amd64', 'arm64')]
|
|
|
|
|
[Alias('arch')]
|
2025-05-02 10:54:46 +02:00
|
|
|
[string]$architecture = $(
|
2025-09-25 16:53:55 +02:00
|
|
|
$defaultArchitecture = 'amd64'
|
|
|
|
|
$arch = try { & go env GOARCH } catch {
|
2025-05-02 10:54:46 +02:00
|
|
|
Write-Warning "Failed retriving the host architecture, using default ($defaultArchitecture). Is Go installed?"
|
|
|
|
|
return $defaultArchitecture
|
|
|
|
|
}
|
2025-09-25 16:53:55 +02:00
|
|
|
if ($arch -cnotin @('arm64', 'amd64')) {
|
2025-05-02 10:54:46 +02:00
|
|
|
Write-Warning "Unsupported architecture $arch. Using default ($defaultArchitecture)."
|
|
|
|
|
return $defaultArchitecture
|
|
|
|
|
}
|
2025-05-07 14:55:48 +02:00
|
|
|
return $arch
|
2025-05-02 10:54:46 +02:00
|
|
|
),
|
|
|
|
|
[parameter(ValueFromRemainingArguments)][object[]]$params = @()
|
|
|
|
|
)
|
2024-05-08 11:59:55 +02:00
|
|
|
|
2026-01-05 11:06:26 +01:00
|
|
|
. $PSScriptRoot\contrib\cirrus\win-lib.ps1
|
2023-09-19 02:09:13 -04:00
|
|
|
|
|
|
|
|
# Targets
|
2025-09-25 16:53:55 +02:00
|
|
|
function Podman-Remote {
|
|
|
|
|
New-Item -ItemType Directory -Force -Path './bin/windows'
|
2023-09-19 02:09:13 -04:00
|
|
|
|
|
|
|
|
$buildInfo = Get-Date -UFormat %s -Millisecond 0
|
2025-10-23 08:18:28 -04:00
|
|
|
$buildInfo = "-X github.com/containers/podman/v6/libpod/define.buildInfo=$buildInfo "
|
2023-09-19 02:09:13 -04:00
|
|
|
$commit = Git-Commit
|
2025-10-23 08:18:28 -04:00
|
|
|
$commit = "-X github.com/containers/podman/v6/libpod/define.gitCommit=$commit "
|
2023-09-19 02:09:13 -04:00
|
|
|
|
2025-05-02 10:54:46 +02:00
|
|
|
$ENV:GOARCH = $architecture
|
2023-09-19 02:09:13 -04:00
|
|
|
Run-Command "go build --ldflags `"$commit $buildInfo `" --tags `"$remotetags`" --o ./bin/windows/podman.exe ./cmd/podman/."
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Make-Clean {
|
|
|
|
|
$paths = @(
|
2025-02-07 16:08:35 +01:00
|
|
|
# Files generated by the `podman` target
|
|
|
|
|
"$PSScriptRoot\bin\windows"
|
|
|
|
|
# Files generated by the `installer` target
|
|
|
|
|
"$PSScriptRoot\test\version\version.exe"
|
|
|
|
|
"$PSScriptRoot\contrib\win-installer\artifacts"
|
|
|
|
|
"$PSScriptRoot\contrib\win-installer\current"
|
|
|
|
|
"$PSScriptRoot\contrib\win-installer\docs"
|
|
|
|
|
"$PSScriptRoot\contrib\win-installer\fetch"
|
2025-09-25 16:53:55 +02:00
|
|
|
"$PSScriptRoot\contrib\win-installer\wix\obj"
|
2025-02-07 16:08:35 +01:00
|
|
|
"$PSScriptRoot\contrib\win-installer\*.log"
|
2025-09-25 16:53:55 +02:00
|
|
|
"$PSScriptRoot\contrib\win-installer\*.msi"
|
2025-02-07 16:08:35 +01:00
|
|
|
"$PSScriptRoot\contrib\win-installer\*.wixpdb"
|
2025-09-25 16:53:55 +02:00
|
|
|
"$PSScriptRoot\contrib\win-installer\shasums"
|
2025-02-07 16:08:35 +01:00
|
|
|
# Files generated by the Documentation target
|
|
|
|
|
"$PSScriptRoot\docs\build\remote\podman-*.html"
|
|
|
|
|
"$PSScriptRoot\docs\build\remote\podman-for-windows.html"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
foreach ($path in $paths) {
|
|
|
|
|
if (Test-Path -Path $path -PathType Container) {
|
|
|
|
|
Remove-Item $path -Recurse -Force -Confirm:$false
|
2025-09-25 16:53:55 +02:00
|
|
|
}
|
|
|
|
|
elseif (Test-Path -Path $path -PathType Leaf) {
|
2025-02-07 16:08:35 +01:00
|
|
|
Remove-Item $path -Force -Confirm:$false
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
|
2025-03-10 18:11:12 +01:00
|
|
|
function Local-Unit {
|
|
|
|
|
Build-Ginkgo
|
2025-09-25 16:53:55 +02:00
|
|
|
$skippackages = 'hack,internal\domain\infra\abi,internal\domain\infra\tunnel,libpod\lock\shm,pkg\api\handlers\libpod,pkg\api\handlers\utils,pkg\bindings,'
|
|
|
|
|
$skippackages += 'pkg\domain\infra\abi,pkg\emulation,pkg\machine\apple,pkg\machine\applehv,pkg\machine\e2e,pkg\machine\libkrun,'
|
2025-12-01 17:30:37 +01:00
|
|
|
$skippackages += 'pkg\machine\proxyenv,pkg\machine\qemu,pkg\specgen\generate,pkg\systemd,test\e2e,test\utils,cmd\rootlessport,'
|
2025-09-25 16:53:55 +02:00
|
|
|
$skippackages += 'pkg\pidhandle'
|
2025-08-16 21:33:53 +03:00
|
|
|
if ($null -eq $ENV:GINKGOTIMEOUT) { $ENV:GINKGOTIMEOUT = '--timeout=15m' }
|
|
|
|
|
Run-Command "./bin/ginkgo.exe -vv -r --tags `"$remotetags`" ${ENV:GINKGOTIMEOUT} --trace --no-color --skip-package `"$skippackages`""
|
2025-03-10 18:11:12 +01:00
|
|
|
}
|
|
|
|
|
|
2023-09-19 02:09:13 -04:00
|
|
|
function Local-Machine {
|
|
|
|
|
param (
|
2025-09-25 16:53:55 +02:00
|
|
|
[string]$files
|
2023-09-19 02:09:13 -04:00
|
|
|
);
|
|
|
|
|
Build-Ginkgo
|
|
|
|
|
if ($files) {
|
2025-09-25 16:53:55 +02:00
|
|
|
$files = "--focus-file ""$files"""
|
|
|
|
|
}
|
|
|
|
|
elseif ($FOCUS_FILE) {
|
2025-05-21 11:10:59 +02:00
|
|
|
$files = "--focus-file ""$FOCUS_FILE"" --silence-skips"
|
|
|
|
|
}
|
|
|
|
|
if ($FOCUS) {
|
|
|
|
|
$focus = "--focus ""$FOCUS"" --silence-skips"
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
|
2025-08-16 21:33:53 +03:00
|
|
|
if ($null -eq $ENV:GINKGOTIMEOUT) { $ENV:GINKGOTIMEOUT = '--timeout=50m' }
|
|
|
|
|
Run-Command "./bin/ginkgo.exe -vv --tags `"$remotetags`" ${ENV:GINKGOTIMEOUT} --trace --no-color $focus $files pkg/machine/e2e/."
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
|
2023-09-26 14:11:08 -04:00
|
|
|
# Expect starting directory to be /podman
|
|
|
|
|
function Win-SSHProxy {
|
|
|
|
|
param (
|
2023-09-28 15:37:11 +02:00
|
|
|
[string]$Version
|
2023-09-26 14:11:08 -04:00
|
|
|
);
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
New-Item -ItemType Directory -Force -Path './bin/windows'
|
2023-09-28 15:37:11 +02:00
|
|
|
if (-Not $Version) {
|
2025-09-25 16:53:55 +02:00
|
|
|
$match = Select-String -Path "$PSScriptRoot\go.mod" -Pattern 'github.com/containers/gvisor-tap-vsock\s+(v[\d\.]+)'
|
2025-03-26 14:47:04 +02:00
|
|
|
$Version = $match.Matches.Groups[1].Value
|
2023-09-28 15:37:11 +02:00
|
|
|
}
|
2025-05-02 10:54:46 +02:00
|
|
|
Write-Host "Downloading gvproxy version $version"
|
2025-09-25 16:53:55 +02:00
|
|
|
if ($architecture -eq 'amd64') {
|
|
|
|
|
curl.exe -sSL -o './bin/windows/gvproxy.exe' --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/gvproxy-windowsgui.exe"
|
|
|
|
|
curl.exe -sSL -o './bin/windows/win-sshproxy.exe' --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/win-sshproxy.exe"
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
curl.exe -sSL -o './bin/windows/gvproxy.exe' --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/gvproxy-windows-arm64.exe"
|
|
|
|
|
curl.exe -sSL -o './bin/windows/win-sshproxy.exe' --retry 5 "https://github.com/containers/gvisor-tap-vsock/releases/download/$Version/win-sshproxy-arm64.exe"
|
2025-05-02 10:54:46 +02:00
|
|
|
}
|
2023-09-26 14:11:08 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Installer {
|
2024-05-08 11:59:55 +02:00
|
|
|
param (
|
|
|
|
|
[string]$version,
|
2025-09-25 16:53:55 +02:00
|
|
|
[string]$suffix = 'dev',
|
|
|
|
|
[string]$installerPath = "$PSScriptRoot\contrib\win-installer"
|
2024-05-08 11:59:55 +02:00
|
|
|
);
|
2025-05-07 14:55:48 +02:00
|
|
|
Write-Host "Building the windows installer for $architecture"
|
2024-05-08 11:59:55 +02:00
|
|
|
|
|
|
|
|
# Check for the files to include in the installer
|
|
|
|
|
$requiredArtifacts = @(
|
|
|
|
|
"$PSScriptRoot\bin\windows\podman.exe"
|
|
|
|
|
"$PSScriptRoot\bin\windows\gvproxy.exe"
|
|
|
|
|
"$PSScriptRoot\bin\windows\win-sshproxy.exe"
|
|
|
|
|
"$PSScriptRoot\docs\build\remote\podman-for-windows.html"
|
|
|
|
|
)
|
|
|
|
|
$requiredArtifacts | ForEach-Object {
|
|
|
|
|
if (!(Test-Path -Path $PSItem -PathType Leaf)) {
|
|
|
|
|
Write-Host "$PSItem not found."
|
2025-04-28 15:34:48 +02:00
|
|
|
Write-Host "Make 'podman', 'win-gvproxy' and 'docs' (or 'docs-using-podman') before making the installer:"
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host ' .\winmake.ps1 podman-remote'
|
|
|
|
|
Write-Host ' .\winmake.ps1 win-gvproxy'
|
|
|
|
|
Write-Host ' .\winmake.ps1 docs or .\winmake.ps1 docs-using-podman'
|
2024-05-08 11:59:55 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Create the ZIP file with the full client distribution
|
2025-09-25 16:53:55 +02:00
|
|
|
$zipFileDest = "$installerPath\current"
|
2024-05-08 11:59:55 +02:00
|
|
|
Build-Distribution-Zip-File -destinationPath $zipFileDest
|
|
|
|
|
|
|
|
|
|
if (-Not $version) {
|
|
|
|
|
# Get Podman version from local source code
|
|
|
|
|
$version = Get-Podman-Version
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
# Run build.ps1
|
2026-01-05 11:06:26 +01:00
|
|
|
Run-Command "$installerPath\build.ps1 -Version $version -Architecture $architecture -LocalReleaseDirPath `"$zipFileDest`""
|
2024-05-08 11:59:55 +02:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Test-Installer {
|
2024-07-05 16:14:46 +02:00
|
|
|
param (
|
|
|
|
|
[string]$version,
|
2025-09-25 16:53:55 +02:00
|
|
|
[ValidateSet('wsl', 'hyperv')]
|
|
|
|
|
[string]$provider = 'wsl'
|
2024-07-05 16:14:46 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (-Not $version) {
|
|
|
|
|
# Get Podman version from local source code
|
|
|
|
|
$version = Get-Podman-Version
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
$msiPath = "$PSScriptRoot\contrib\win-installer\podman-${version}.msi"
|
|
|
|
|
if (!(Test-Path -Path $msiPath -PathType Leaf)) {
|
|
|
|
|
Write-Host "MSI executable not found in path $msiPath."
|
|
|
|
|
Write-Host "Make 'installer' before making the installer test:"
|
|
|
|
|
Write-Host ' .\winmake.ps1 installer'
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$nextMsiPath = "$PSScriptRoot\contrib\win-installer\podman-9.9.9.msi"
|
|
|
|
|
if (!(Test-Path -Path $nextMsiPath -PathType Leaf)) {
|
|
|
|
|
Write-Host 'The automated tests include testing the upgrade from current version to a future version.'
|
|
|
|
|
Write-Host 'That requires a version 9.9.9 of the installer:'
|
|
|
|
|
Write-Host ' .\winmake.ps1 installer 9.9.9'
|
|
|
|
|
Write-Host 'Build it and retry running installertest.'
|
|
|
|
|
Exit 1
|
2024-07-05 16:14:46 +02:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
$command = "$PSScriptRoot\contrib\win-installer\test.ps1"
|
|
|
|
|
$command += ' -scenario all'
|
|
|
|
|
$command += " -provider $provider"
|
|
|
|
|
$command += " -msiPath $msiPath"
|
|
|
|
|
$command += " -nextMsiPath $nextMsiPath"
|
|
|
|
|
Run-Command "${command}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Documentation {
|
|
|
|
|
Write-Host 'Generating the documentation artifacts'
|
2024-05-08 11:59:55 +02:00
|
|
|
# Check that pandoc is installed
|
2025-09-25 16:53:55 +02:00
|
|
|
if (!(Get-Command -Name 'pandoc' -ErrorAction SilentlyContinue)) {
|
|
|
|
|
Write-Host 'Pandoc not found. Pandoc is required to convert the documentation Markdown files into HTML files.'
|
2025-04-28 15:34:48 +02:00
|
|
|
Write-Host "Alternatively, use '.\winmake docs-using-podman' to use a container to run pandoc and generate the documentation."
|
2024-05-08 11:59:55 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
# Check that the podman client is built
|
|
|
|
|
$podmanClient = "$PSScriptRoot\bin\windows\podman.exe"
|
|
|
|
|
if (!(Test-Path -Path $podmanClient -PathType Leaf)) {
|
|
|
|
|
Write-Host "$podmanClient not found. Make 'podman-remote' before 'documentation'."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
Run-Command "$PSScriptRoot\docs\make.ps1 $podmanClient"
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-28 15:34:48 +02:00
|
|
|
# DocumentationUsingPodman generates documentation with pandoc running in a container.
|
|
|
|
|
# This is usefult on Windows arm64 where pandoc is not available.
|
|
|
|
|
# It's also useful to generate documentation identical to CI.
|
|
|
|
|
# It requires the podman client to be built and a podman machine running.
|
|
|
|
|
# The whole podman git repository is bind mounted in the container at /podman.
|
|
|
|
|
# The documentation is generated by running the command `make podman-remote-windows-docs`.
|
|
|
|
|
# The generated documentation is stored in the directory docs/build/remote.
|
2025-09-25 16:53:55 +02:00
|
|
|
function DocumentationUsingPodman {
|
|
|
|
|
Write-Host 'Generating documentation artifacts'
|
2025-04-28 15:34:48 +02:00
|
|
|
# Check that podman has been built
|
|
|
|
|
$podmanClient = "${PSScriptRoot}\bin\windows\podman.exe"
|
|
|
|
|
if (!(Test-Path -Path $podmanClient -PathType Leaf)) {
|
|
|
|
|
Write-Host "$podmanClient not found. Make 'podman-remote' before 'documentation'."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
# Check that a podman machine exist
|
|
|
|
|
$currentMachine = (& ${podmanClient} machine info -f json | ConvertFrom-Json).Host.CurrentMachine
|
|
|
|
|
if (!$currentMachine) {
|
|
|
|
|
Write-Host "Podman machine doesn't exist. Initialize and start one before running the validate script."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
# Check that the podman machine is running
|
|
|
|
|
$state = (& ${podmanClient} machine info -f json | ConvertFrom-Json).Host.MachineState
|
2025-09-25 16:53:55 +02:00
|
|
|
if ($state -ne 'Running') {
|
|
|
|
|
Write-Host 'Podman machine is not running. Start the machine before running the validate script.'
|
2025-04-28 15:34:48 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Building the image to generate the documentation'
|
2025-04-28 15:34:48 +02:00
|
|
|
Run-Command "${podmanClient} build --build-arg TARGET_OS=windows -t podman-docs-generator ${PSScriptRoot}/docs"
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Starting the container to run the documentation build'
|
2025-04-28 15:34:48 +02:00
|
|
|
Run-Command "${podmanClient} run -t --rm -v ${PSScriptRoot}:/podman podman-docs-generator"
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Validate {
|
|
|
|
|
$podmanExecutable = 'podman'
|
2024-05-08 11:59:55 +02:00
|
|
|
$podmanSrcVolumeMount = "${PSScriptRoot}:/go/src/github.com/containers/podman"
|
|
|
|
|
# All files bind mounted from a Windows host are marked as executable.
|
|
|
|
|
# That makes the pre-commit hook "check-executables-have-shebangs" fail.
|
|
|
|
|
# Setting the environment variable "SKIP=check-executables-have-shebangs"
|
|
|
|
|
# allow to skip that pre-commit hook.
|
2025-09-25 16:53:55 +02:00
|
|
|
$podmanEnvVariable = '-e SKIP=check-executables-have-shebangs'
|
2024-05-08 11:59:55 +02:00
|
|
|
$podmanRunArgs = "--rm -v $podmanSrcVolumeMount --security-opt label=disable -t -w /go/src/github.com/containers/podman $podmanEnvVariable"
|
2025-09-25 16:53:55 +02:00
|
|
|
$validateImage = 'quay.io/libpod/validatepr:latest'
|
|
|
|
|
$validateCommand = 'make .validatepr'
|
2024-05-08 11:59:55 +02:00
|
|
|
|
|
|
|
|
# Check that podman is installed
|
|
|
|
|
if (!(Get-Command -Name $podmanExecutable -ErrorAction SilentlyContinue)) {
|
|
|
|
|
Write-Host "$podmanExecutable not found. $podmanExecutable is required to run the validate script."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Check that a podman machine exist
|
|
|
|
|
$currentMachine = (podman machine info -f json | ConvertFrom-Json).Host.CurrentMachine
|
|
|
|
|
if (!$currentMachine) {
|
|
|
|
|
Write-Host "Podman machine doesn't exist. Initialize and start one before running the validate script."
|
|
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Check that the podman machine is running
|
|
|
|
|
$state = (podman machine info -f json | ConvertFrom-Json).Host.MachineState
|
2025-09-25 16:53:55 +02:00
|
|
|
if ($state -ne 'Running') {
|
|
|
|
|
Write-Host 'Podman machine is not running. Start the machine before running the validate script.'
|
2024-05-08 11:59:55 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Run-Command "$podmanExecutable run $podmanRunArgs $validateImage $validateCommand"
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Lint {
|
2024-05-08 11:59:55 +02:00
|
|
|
# Check that golangci-lint is installed
|
2025-09-25 16:53:55 +02:00
|
|
|
if (!(Get-Command -Name 'golangci-lint' -ErrorAction SilentlyContinue)) {
|
|
|
|
|
Write-Host 'The tool "golangci-lint" not found. Install https://golangci-lint.run/ before running the lint script.'
|
2024-05-08 11:59:55 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Check that pre-commit is installed
|
2025-09-25 16:53:55 +02:00
|
|
|
if (!(Get-Command -Name 'pre-commit' -ErrorAction SilentlyContinue)) {
|
|
|
|
|
Write-Host 'The tool "pre-commit" not found. Install https://pre-commit.com/ before running the lint script.'
|
2024-05-08 11:59:55 +02:00
|
|
|
Exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
Run-Command 'pre-commit run --all-files'
|
2024-11-20 13:14:35 +01:00
|
|
|
Run-Command "golangci-lint run --timeout=10m --build-tags=`"$remotetags`" $PSScriptRoot\cmd\podman"
|
2024-05-08 11:59:55 +02:00
|
|
|
}
|
|
|
|
|
|
2023-09-19 02:09:13 -04:00
|
|
|
# Helpers
|
2025-09-25 16:53:55 +02:00
|
|
|
function Build-Ginkgo {
|
test/tools/vendor: drop ginkgo
It appears[1] that ginkgo binary can be easily built from the top-level
vendor, so it does not make sense to have a second copy in test/tools
(and a hassle of keeping the two in sync).
Inspired by [1], [2], and a run of make localtest, which shows:
> Ginkgo detected a version mismatch between the Ginkgo CLI and the version of Ginkgo imported by your packages:
> Ginkgo CLI Version:
> 2.22.1
> Mismatched package versions found:
> 2.23.3 used by podman, common, containers, parse, quadlet, rootlessport, abi, tunnel, libpod, events, file, shm, logs, annotations, libpod, utils, apiutil, auth, ctime, abi, expansion, utils, emulation, env, errorhandling, machine, compression, connection, define, ocipull, provider, proxyenv, qemu, command, shim, vmconfigs, rootless, signal, specgen, generate, kube, specgenutil, systemd, generate, notifyproxy, parser, timetype, trust, util, utils
[1]: https://github.com/containers/podman/pull/25522/commits/af29bb5b6ed0c779d4f2a89186578d3666849458#r2020246403
[2]: https://github.com/containers/podman/pull/25560/commits/e6c7ec94e22936750a450fa36a69a9cfe31f2328#r2020230241
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-03-30 13:30:25 -07:00
|
|
|
if (Test-Path -Path ./bin/ginkgo.exe -PathType Leaf) {
|
2023-09-19 02:09:13 -04:00
|
|
|
return
|
|
|
|
|
}
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Building Ginkgo'
|
|
|
|
|
Run-Command 'go build -o ./bin/ginkgo.exe ./vendor/github.com/onsi/ginkgo/v2/ginkgo'
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Git-Commit {
|
2023-09-19 02:09:13 -04:00
|
|
|
# git is not installed by default on windows,
|
|
|
|
|
# so if we can't get the commit, we don't include this info
|
2025-09-25 16:53:55 +02:00
|
|
|
Get-Command git -ErrorAction SilentlyContinue | out-null
|
|
|
|
|
if (!$?) {
|
2023-09-19 02:09:13 -04:00
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
$commit = git rev-parse HEAD
|
|
|
|
|
$dirty = git status --porcelain --untracked-files=no
|
2025-09-25 16:53:55 +02:00
|
|
|
if ($dirty) {
|
2023-09-19 02:09:13 -04:00
|
|
|
$commit = "$commit-dirty"
|
2023-09-26 14:11:08 -04:00
|
|
|
}
|
|
|
|
|
return $commit
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Build-Distribution-Zip-File {
|
2024-05-08 11:59:55 +02:00
|
|
|
param (
|
|
|
|
|
[string]$destinationPath
|
2025-09-25 16:53:55 +02:00
|
|
|
);
|
2024-05-08 11:59:55 +02:00
|
|
|
$binariesFolder = "$PSScriptRoot\bin\windows"
|
|
|
|
|
$documentationFolder = "$PSScriptRoot\docs\build\remote\"
|
2025-05-02 10:54:46 +02:00
|
|
|
$zipFile = "$destinationPath\podman-remote-release-windows_$architecture.zip"
|
2024-05-08 11:59:55 +02:00
|
|
|
|
|
|
|
|
# Create a temporary folder to store the distribution files
|
|
|
|
|
$tempFolder = New-Item -ItemType Directory -Force -Path "$env:TEMP\podman-windows"
|
|
|
|
|
|
|
|
|
|
# Copy bin\windows\ content to the temporary folder
|
|
|
|
|
Copy-Item -Recurse -Force -Path "$binariesFolder\*" -Destination "$tempFolder\"
|
|
|
|
|
|
|
|
|
|
# Copy docs\build\remote to the temporary folder
|
|
|
|
|
Copy-Item -Recurse -Force -Path "$documentationFolder" -Destination "$tempFolder\docs\"
|
|
|
|
|
|
|
|
|
|
# If $destination path doesn't exist, create it
|
|
|
|
|
if (-Not (Test-Path -Path $destinationPath -PathType Container)) {
|
|
|
|
|
New-Item -ItemType Directory -Force -Path $destinationPath
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Create the ZIP file with the full client distribution
|
|
|
|
|
Compress-Archive -Path "$tempFolder\*" -DestinationPath $zipFile -Force
|
|
|
|
|
|
|
|
|
|
# Delete the temporary folder
|
|
|
|
|
Remove-Item -Recurse -Force -Path "$tempFolder"
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
function Get-Podman-Version {
|
2024-05-08 11:59:55 +02:00
|
|
|
$versionSrc = "$PSScriptRoot\test\version\"
|
|
|
|
|
$versionBin = "$PSScriptRoot\test\version\version.exe"
|
2024-11-20 13:14:35 +01:00
|
|
|
Run-Command "go build --o `"$versionBin`" `"$versionSrc`""
|
2024-05-08 11:59:55 +02:00
|
|
|
$version = Invoke-Expression "$versionBin"
|
|
|
|
|
# Remove the '-dev' suffix from the version
|
2025-09-25 16:53:55 +02:00
|
|
|
$version = $version -replace '-.*', ''
|
2024-05-08 11:59:55 +02:00
|
|
|
return $version
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-19 02:09:13 -04:00
|
|
|
# Init script
|
2025-05-02 10:54:46 +02:00
|
|
|
$target = $params[0]
|
2023-09-19 02:09:13 -04:00
|
|
|
|
2025-09-25 16:53:55 +02:00
|
|
|
$remotetags = 'remote exclude_graphdriver_btrfs containers_image_openpgp'
|
2023-09-19 02:09:13 -04:00
|
|
|
|
|
|
|
|
switch ($target) {
|
2025-09-25 16:53:55 +02:00
|
|
|
{ $_ -in '', 'podman-remote', 'podman' } {
|
2023-09-19 02:09:13 -04:00
|
|
|
Podman-Remote
|
|
|
|
|
}
|
2026-01-05 11:06:26 +01:00
|
|
|
'whoami' {
|
|
|
|
|
Write-Host "Current user: $(whoami)"
|
|
|
|
|
}
|
2025-03-10 18:11:12 +01:00
|
|
|
'localunit' {
|
|
|
|
|
Local-Unit
|
|
|
|
|
}
|
2023-09-19 02:09:13 -04:00
|
|
|
'localmachine' {
|
2025-05-02 10:54:46 +02:00
|
|
|
if ($params.Count -gt 1) {
|
|
|
|
|
$files = $params[1]
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
2025-05-02 10:54:46 +02:00
|
|
|
Local-Machine -files $files
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
'clean' {
|
|
|
|
|
Make-Clean
|
|
|
|
|
}
|
2025-09-25 16:53:55 +02:00
|
|
|
{ $_ -in 'win-sshproxy', 'win-gvproxy' } {
|
2025-05-02 10:54:46 +02:00
|
|
|
if ($params.Count -gt 1) {
|
|
|
|
|
$ref = $params[1]
|
2023-09-26 14:11:08 -04:00
|
|
|
}
|
2024-10-28 19:46:25 +05:30
|
|
|
Win-SSHProxy($ref)
|
2023-09-26 14:11:08 -04:00
|
|
|
}
|
2024-05-08 11:59:55 +02:00
|
|
|
'installer' {
|
2025-05-02 10:54:46 +02:00
|
|
|
if ($params.Count -gt 1) {
|
|
|
|
|
Installer -version $params[1]
|
2025-09-25 16:53:55 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2024-07-18 11:06:41 +02:00
|
|
|
Installer
|
|
|
|
|
}
|
2024-05-08 11:59:55 +02:00
|
|
|
}
|
2024-07-05 16:14:46 +02:00
|
|
|
'installertest' {
|
2025-05-02 10:54:46 +02:00
|
|
|
if ($params.Count -gt 1) {
|
|
|
|
|
Test-Installer -provider $params[1]
|
2025-09-25 16:53:55 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2024-07-05 16:14:46 +02:00
|
|
|
Test-Installer
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-08 11:59:55 +02:00
|
|
|
'docs' {
|
|
|
|
|
Documentation
|
|
|
|
|
}
|
2025-04-28 15:34:48 +02:00
|
|
|
'docs-using-podman' {
|
|
|
|
|
DocumentationUsingPodman
|
|
|
|
|
}
|
2024-05-08 11:59:55 +02:00
|
|
|
'validatepr' {
|
|
|
|
|
Validate
|
|
|
|
|
}
|
|
|
|
|
'lint' {
|
|
|
|
|
Lint
|
|
|
|
|
}
|
2023-09-19 02:09:13 -04:00
|
|
|
default {
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Usage: ' $MyInvocation.MyCommand.Name '<target> [options] [<-architecture|-arch>=<amd64|arm64>]'
|
2023-09-19 02:09:13 -04:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Build podman-remote '
|
|
|
|
|
Write-Host ' .\winmake podman-remote'
|
2023-09-19 02:09:13 -04:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Run all unit tests '
|
|
|
|
|
Write-Host ' .\winmake localunit'
|
2025-03-10 18:11:12 +01:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Run all machine tests '
|
|
|
|
|
Write-Host ' .\winmake localmachine'
|
2023-09-19 02:09:13 -04:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Run specfic machine tests '
|
|
|
|
|
Write-Host ' .\winmake localmachine 'basic_test.go""
|
2024-02-29 15:26:10 +01:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Download win-gvproxy and win-sshproxy helpers'
|
|
|
|
|
Write-Host ' .\winmake win-gvproxy'
|
2024-05-08 11:59:55 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Build the windows installer'
|
|
|
|
|
Write-Host ' .\winmake installer'
|
2024-05-08 11:59:55 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Run windows installer tests'
|
|
|
|
|
Write-Host ' .\winmake installertest hyperv'
|
2024-07-05 16:14:46 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Generate the documentation artifacts'
|
|
|
|
|
Write-Host ' .\winmake docs'
|
2024-05-08 11:59:55 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Generate the documentation artifacts by running pandoc in a container'
|
|
|
|
|
Write-Host ' .\winmake docs-using-podman'
|
2025-04-28 15:34:48 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Validate code changes before submitting a PR'
|
|
|
|
|
Write-Host ' .\winmake validatepr'
|
2024-05-08 11:59:55 +02:00
|
|
|
Write-Host
|
2025-09-25 16:53:55 +02:00
|
|
|
Write-Host 'Example: Run linters'
|
|
|
|
|
Write-Host ' .\winmake lint'
|
2023-09-19 02:09:13 -04:00
|
|
|
}
|
|
|
|
|
}
|