Merge pull request #1379 from zabbix/trunk_windows

Updated build process for Zabbix agent (windows)
This commit is contained in:
Alexey Pustovalov 2024-05-20 11:48:10 +09:00 committed by GitHub
commit 314ea3f842
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 18 deletions

View File

@ -41,12 +41,14 @@ LABEL org.opencontainers.image.title="Zabbix agent build base for Windows" `
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
COPY modbus.vs16.* C:\build_src\libmodbus_project\
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
`
$env:PATH = [string]::Format('{0}\perl\perl\bin;{1}\NASM;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
`
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); `
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
@ -124,20 +126,16 @@ RUN Set-Location -Path $env:SystemDrive\.; `
}; `
Wait-Process -name msiexec; `
Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
`
$env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; `
[Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); `
`
Write-Host 'Visual Studio components installation cleanup'; `
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Path $env:SystemDrive\vs_buildtools.exe; `
Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; `
Write-Host 'Removing downloaded...'; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...';
COPY modbus.vs16.* C:\build_src\libmodbus_project\
RUN Set-Location -Path $env:SystemDrive\.; `
Write-Host 'Build environment is ready...'; `
Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `

View File

@ -44,7 +44,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{0}\msys64\usr\bin;{0}\msys64\ucrt64\bin;{0}\msys64\mingw64\bin', $env:SystemDrive); `
@ -182,7 +182,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...'; `
`
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `

View File

@ -41,7 +41,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{0}\msys64\usr\bin;{0}\msys64\clang64\bin', $env:SystemDrive); `
@ -141,7 +141,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...'; `
`
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `

View File

@ -44,7 +44,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
$env:PATH = $env:PATH + [string]::Format(';{0}\msys64\usr\bin;{0}\msys64\ucrt64\bin;{0}\msys64\mingw64\bin', $env:SystemDrive); `
@ -181,7 +181,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
Remove-Item -Force -Recurse $env:TEMP\*; `
Write-Host 'Build environment is ready...'; `
Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; `
New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; `

View File

@ -36,7 +36,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Set-Location -Path $env:SystemDrive\.; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; `
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
`
$env:PATH = [string]::Format('{0}\vcpkg;{0}\llvm_mingw\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `