mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +08:00
Merge pull request #20157 from ashley-cui/makesshproxy
[CI:DOCS] Add win-sshproxy target to winmake
This commit is contained in:
1
Makefile
1
Makefile
@ -207,7 +207,6 @@ endif
|
|||||||
# win-sshproxy is checked out manually to keep from pulling in gvisor and it's transitive
|
# win-sshproxy is checked out manually to keep from pulling in gvisor and it's transitive
|
||||||
# dependencies. This is only used for the Windows client archives, which must
|
# dependencies. This is only used for the Windows client archives, which must
|
||||||
# include this lightweight helper binary.
|
# include this lightweight helper binary.
|
||||||
#
|
|
||||||
GV_GITURL=https://github.com/containers/gvisor-tap-vsock.git
|
GV_GITURL=https://github.com/containers/gvisor-tap-vsock.git
|
||||||
GV_SHA=db608827124caa71ba411cec8ea959bb942984fe
|
GV_SHA=db608827124caa71ba411cec8ea959bb942984fe
|
||||||
|
|
||||||
|
51
winmake.ps1
51
winmake.ps1
@ -2,7 +2,7 @@ $ErrorActionPreference = 'Stop'
|
|||||||
|
|
||||||
# Targets
|
# Targets
|
||||||
function Podman-Remote{
|
function Podman-Remote{
|
||||||
New-Item ./bin/windows -ItemType Directory -ea 0
|
New-Item -ItemType Directory -Force -Path "./bin/windows"
|
||||||
|
|
||||||
$buildInfo = Get-Date -UFormat %s -Millisecond 0
|
$buildInfo = Get-Date -UFormat %s -Millisecond 0
|
||||||
$buildInfo = "-X github.com/containers/podman/v4/libpod/define.buildInfo=$buildInfo "
|
$buildInfo = "-X github.com/containers/podman/v4/libpod/define.buildInfo=$buildInfo "
|
||||||
@ -28,6 +28,49 @@ function Local-Machine {
|
|||||||
Run-Command "./test/tools/build/ginkgo.exe -vv --tags `"$remotetags`" -timeout=90m --trace --no-color $files pkg/machine/e2e/. "
|
Run-Command "./test/tools/build/ginkgo.exe -vv --tags `"$remotetags`" -timeout=90m --trace --no-color $files pkg/machine/e2e/. "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Expect starting directory to be /podman
|
||||||
|
function Win-SSHProxy {
|
||||||
|
param (
|
||||||
|
[string]$Ref
|
||||||
|
);
|
||||||
|
|
||||||
|
# git is not installed by default on windows
|
||||||
|
# fail if git doesn't exist
|
||||||
|
Get-Command git -ErrorAction SilentlyContinue | out-null
|
||||||
|
if(!$?){
|
||||||
|
Write-Host "Git not installed, cannot build Win-SSHProxy"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Test-Path ./tmp-gv) {
|
||||||
|
Remove-Item ./tmp-gv -Recurse -Force -Confirm:$false
|
||||||
|
}
|
||||||
|
|
||||||
|
$GV_GITURL = "https://github.com/containers/gvisor-tap-vsock.git"
|
||||||
|
|
||||||
|
New-Item ./tmp-gv -ItemType Directory -ea 0
|
||||||
|
Push-Location ./tmp-gv
|
||||||
|
Run-Command "git init"
|
||||||
|
Run-Command "git remote add origin $GV_GITURL"
|
||||||
|
Run-Command "git fetch --depth 1 origin main"
|
||||||
|
Run-Command "git fetch --depth 1 --tags"
|
||||||
|
Run-Command "git checkout main"
|
||||||
|
if (-Not $Ref) {
|
||||||
|
Write-Host "empty"
|
||||||
|
$Ref = git describe --abbrev=0
|
||||||
|
}
|
||||||
|
Run-Command "git checkout $Ref"
|
||||||
|
Run-Command "go build -ldflags -H=windowsgui -o bin/win-sshproxy.exe ./cmd/win-sshproxy"
|
||||||
|
Run-Command "go build -ldflags -H=windowsgui -o bin/gvproxy.exe ./cmd/gvproxy"
|
||||||
|
Pop-Location
|
||||||
|
|
||||||
|
# Move location to ./bin/windows for packaging script and for Windows binary testing
|
||||||
|
New-Item -ItemType Directory -Force -Path "./bin/windows"
|
||||||
|
Copy-Item -Path "tmp-gv/bin/win-sshproxy.exe" -Destination "./bin/windows/"
|
||||||
|
Copy-Item -Path "tmp-gv/bin/gvproxy.exe" -Destination "./bin/windows/"
|
||||||
|
Remove-Item ./tmp-gv -Recurse -Force -Confirm:$false
|
||||||
|
}
|
||||||
|
|
||||||
# Helpers
|
# Helpers
|
||||||
function Build-Ginkgo{
|
function Build-Ginkgo{
|
||||||
if (Test-Path -Path ./test/tools/build/ginkgo.exe -PathType Leaf) {
|
if (Test-Path -Path ./test/tools/build/ginkgo.exe -PathType Leaf) {
|
||||||
@ -88,6 +131,12 @@ switch ($target) {
|
|||||||
'clean' {
|
'clean' {
|
||||||
Make-Clean
|
Make-Clean
|
||||||
}
|
}
|
||||||
|
'win-sshproxy' {
|
||||||
|
if ($args.Count -gt 1) {
|
||||||
|
$ref = $args[1]
|
||||||
|
}
|
||||||
|
Win-SSHProxy -Ref $ref
|
||||||
|
}
|
||||||
default {
|
default {
|
||||||
Write-Host "Usage: " $MyInvocation.MyCommand.Name "<target> [options]"
|
Write-Host "Usage: " $MyInvocation.MyCommand.Name "<target> [options]"
|
||||||
Write-Host
|
Write-Host
|
||||||
|
Reference in New Issue
Block a user