From 3ad97baa99a43e66301a15f48b1e74bd1d3ddbe8 Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Fri, 31 Mar 2023 11:43:58 +0000 Subject: [PATCH] set vsdevcmd paths by hand --- containers/agent-windows-buildkite/Dockerfile | 21 +++++++++++++++++-- containers/agent-windows-buildkite/build.ps1 | 19 ++++++----------- scripts/windows_agent_start_buildkite.ps1 | 3 +-- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/containers/agent-windows-buildkite/Dockerfile b/containers/agent-windows-buildkite/Dockerfile index afe7dc5..ba34174 100644 --- a/containers/agent-windows-buildkite/Dockerfile +++ b/containers/agent-windows-buildkite/Dockerfile @@ -83,10 +83,27 @@ ENV PYTHONIOENCODING=UTF-8 # 'clang.exe' - add this last to let the other one have precedence. # To use these compilers, use the triple prefixed form, e.g. # x86_64-w64-mingw32-clang. +# C:\buildtools and SDK paths are ones that are set by c:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 -host_arch=amd64 RUN powershell -Command ` [System.Environment]::SetEnvironmentVariable('PATH', ` - [System.Environment]::GetEnvironmentVariable('PATH', 'machine') + ';C:\Program Files\Git\usr\bin;C:\llvm-mingw\bin', ` - 'machine') + [System.Environment]::GetEnvironmentVariable('PATH', 'machine') + ';C:\Program Files\Git\usr\bin;C:\llvm-mingw\bin' ` + + ';C:\BuildTools\Common7\IDE\' ` + + ';C:\BuildTools\Common7\IDE\CommonExt ensions\Microsoft\TeamFoundation\Team Explorer' ` + + ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin' ` + + ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja' ` + + ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer' ` + + ';C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow' ` + + ';C:\BuildTools\Common7\IDE\VC\VCPackages' ` + + ';C:\BuildTools\Common7\Tools\' ` + + ';C:\BuildTools\Common7\Tools\devinit' ` + + ';C:\BuildTools\MSBuild\Current\Bin' ` + + ';C:\BuildTools\MSBuild\Current\bin\Roslyn' ` + + ';C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64' ` + + ';C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\' ` + + ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64' ` + + ';C:\Program Files (x86)\Windows Kits\10\bin\x64' ` + + ';C:\Windows\Microsoft.NET\Framework64\v4.0.30319' ` + ,'machine') # use this folder to store the worksapce' VOLUME C:\ws diff --git a/containers/agent-windows-buildkite/build.ps1 b/containers/agent-windows-buildkite/build.ps1 index 8a605a2..530073a 100644 --- a/containers/agent-windows-buildkite/build.ps1 +++ b/containers/agent-windows-buildkite/build.ps1 @@ -14,19 +14,12 @@ $ROOT_DIR=(Get-Item $PSScriptRoot).Parent.FullName $IMAGE_NAME='agent-windows-buildkite' - -# get config options -Get-Content "${ROOT_DIR}\..\k8s_config" | Foreach-Object{ - if (! $_.StartsWith('#') ){ - $var = $_.Split('=') - New-Variable -Name $var[0] -Value $var[1] - } -} - -$QUALIFIED_NAME="${GCR_HOSTNAME}/${GCP_PROJECT}/${IMAGE_NAME}" +$QUALIFIED_NAME='gcr.io/llvm-premerge-checks/agent-windows-buildkite' Write-Host "Building ${IMAGE_NAME}..." -docker build . -t "${IMAGE_NAME}:latest" -docker tag "${IMAGE_NAME}:latest" "${QUALIFIED_NAME}:latest" +docker build . -t "${IMAGE_NAME}" +docker tag "${IMAGE_NAME}" "${QUALIFIED_NAME}:latest" +docker tag "${IMAGE_NAME}" "${QUALIFIED_NAME}:stable" Write-Host "to push image, run" -Write-Host "docker push ${QUALIFIED_NAME}:latest" \ No newline at end of file +Write-Host "docker push ${QUALIFIED_NAME}:latest" +Write-Host "docker push ${QUALIFIED_NAME}:stable" \ No newline at end of file diff --git a/scripts/windows_agent_start_buildkite.ps1 b/scripts/windows_agent_start_buildkite.ps1 index f3c3bdf..44a3898 100644 --- a/scripts/windows_agent_start_buildkite.ps1 +++ b/scripts/windows_agent_start_buildkite.ps1 @@ -21,8 +21,7 @@ param( [string]$workdir = "c:\ws" ) -New-Item $workdir -Force -ItemType Directorys - +New-Item $workdir -Force -ItemType Directory cd c:\llvm-premerge-checks git pull c:\llvm-premerge-checks\scripts\windows\start_container.ps1 -version $version -workdir $workdir